I am trying to build a multi-module Maven project with the net.alchim31.maven:scala-maven-plugin:3.1.3 and am having classpath issues when compared to a single module project.My first project layout looked like -project/pom.xmlproject/src/main/scalaproject/src/test/scalaproject/src/test/resourcesIn my Specs2 tests I often use something like:Path.fromString("src/test/resources/my/pkg/file.txt")To get access to an external file that contains some data relevant to the test.This all works perfectly.However I am now trying to move to a multi-module project structured like so -project/pom.xmlproject/parent/pom.xmlproject/module1/pom.xmlproject/module1/src/main/scalaproject/module1/src/test/scalaproject/module1/src/test/resourcesThe project/pom.xml is the top-level pom and really just references the parent pom, and declares the modules.The project/module1/pom.xml is specific to the module, it includes the parent pom.If you wish to see our pom files - our project is on GitHub - https://github.com/digital-preservation/csv-validator
The problem is that is i run 'mvn clean install' from the project/ folder using the top-level pom, my tests in module1/ now fail, because when they try and load their resources, they get an invalid path. i.e. -Path.fromString("src/test/resources/my/pkg/file.txt")now resolves to "project/src/test/resources/my/pkg/file.txt", whereas it should resolve to "project/module1/src/test/resources/my/pkg/file.txt".If I do change into the module1/ sub-folder and run 'mvn clean install' then all works correctly. During test execution it seems the classpath is resolving relative to the mvn command and not the module under compilation.I think this may be a problem with the scala-maven-plugin, because we use this multi-module pattern a lot with many Java projects (using the maven-compiler-plugin) and have not experienced any problems.
Any ideas?Thanks Adam.--
---
You received this message because you are subscribed to the Google Groups "Maven and Scala" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-and-sca...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.