Skip to content

Issue with relative paths with maven init #4915

Open
@prog-r-amer

Description

@prog-r-amer

Hi, i was trying ./mill init with mill 0.12.10 (and also a 0.13 version) on my multi module maven project (with wsl linux). I get the following stack trace

[1/1] init
[7/7] mill.init.InitMavenModule.init
[7] converting Maven build
[7] Exception in thread "main" os.PathError$InvalidSegment: [../backend-api] is not a valid path segment. [/] is not a valid character to appear in a non-literal path segment. If you are dealing with dynamic path-strings coming from external sources, use the Path(...)/RelPath(...)/SubPath(...) constructor calls to convert them.
[7]     at os.BasePath$.fail$1(Path.scala:179)
[7]     at os.BasePath$.checkSegment(Path.scala:186)
[7]     at os.PathChunk$StringPathChunkInternal.<init>(Path.scala:70)
[7]     at os.StringPathChunkConversion.stringToPathChunk(Path.scala:19)
[7]     at os.StringPathChunkConversion.stringToPathChunk$(Path.scala:18)
[7]     at os.PathChunk$.stringToPathChunk(Path.scala:22)
[7]     at mill.main.maven.MavenBuildGenMain$.$anonfun$run$2(MavenBuildGenMain.scala:53)
[7]     at scala.collection.immutable.List.map(List.scala:247)
[7]     at scala.collection.immutable.List.map(List.scala:79)
[7]     at os.PathChunk$SeqPathChunk.<init>(Path.scala:101)
[7]     at os.PathChunk$.SeqPathChunk(Path.scala:95)
[7]     at mill.main.maven.MavenBuildGenMain$.$anonfun$run$1(MavenBuildGenMain.scala:53)
[7]     at mill.main.buildgen.Tree$.recurse$2(Tree.scala:36)
[7]     at mill.main.buildgen.Tree$.$anonfun$from$1(Tree.scala:37)
[7]     at scala.collection.Iterator$$anon$9.next(Iterator.scala:584)
[7]     at scala.collection.immutable.List.prependedAll(List.scala:153)
[7]     at scala.collection.immutable.List$.from(List.scala:685)
[7]     at scala.collection.immutable.List$.from(List.scala:682)
[7]     at scala.collection.SeqFactory$Delegate.from(Factory.scala:306)
[7]     at scala.collection.immutable.Seq$.from(Seq.scala:42)
[7]     at scala.collection.IterableOnceOps.toSeq(IterableOnce.scala:1473)
[7]     at scala.collection.IterableOnceOps.toSeq$(IterableOnce.scala:1473)
[7]     at scala.collection.AbstractIterator.toSeq(Iterator.scala:1306)
[7]     at mill.main.buildgen.Tree$.recurse$2(Tree.scala:37)
[7]     at mill.main.buildgen.Tree$.from(Tree.scala:40)
[7]     at mill.main.maven.MavenBuildGenMain$.run(MavenBuildGenMain.scala:52)
[7]     at mill.main.maven.MavenBuildGenMain$.main(MavenBuildGenMain.scala:44)
[7]     at mill.main.maven.MavenBuildGenMain.main(MavenBuildGenMain.scala)
[1/1, 1 failed] ============================== init ============================== 10s
1 tasks failed
init java.lang.Exception: 1 tasks failed

As seen in the stack trace, it's a multi module build with modules defined like this in the parent module:

    <modules>
        <module>../backend-api</module>
   </modules>

I hope this is an actual bug and not something that's not supposed to be supported, since I was just playing around. I haven't really looked around in the source yet since I am just learning scala.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions