Hi,
Has anyone else seen this?
In a nutshell, repos.txt doesn't get loaded whilst running maven integration tests. I spotted this because my maven repo is not in the default location (due to the setup of our Windows accounts at work - another story). Changing mavenLocal in the distribution's conf/repos.txt takes no effect and, as a result, integration tests fail with errors like this:
org.vertx.java.platform.PlatformManagerException: Module io.vertx~lang-rhino~2.0.0-final not found in any repositories
To check this, I pulled vert.x 2.1M2 source and modified DefaultPlatformManager.java to
1. dump the class path urls in the constructor
2. check which file was loaded in findReposFile()
3. dump the contents of the file loaded
The results:
1. the classpath points only to the surefire booter in the target of my test project:
/C:/Dev/source/vertx/testvertx1/target/surefire/surefirebooter2078377583262873002.jar
2. The repos.txt file cannot be located (as identified by REPOS_FILE_NAME). Instead default-repos.txt is loaded from the vertx-platform jar.
3. default-repos.txt points to the default maven repo:
I worked around this by adding the following to the maven-failsafe-plugin settings in my project's pom.xml:
<additionalClasspathElements>
<additionalClasspathElement>C:\Dev\source\vertx\vert.x-2.1M2\build\vert.x-2.1M2\conf</additionalClasspathElement>
</additionalClasspathElements>
As a result:
The classpath reported in (1) still only points to the surefire booter but, during the run, repos.txt is located and loaded correctly in (2) above. Also for (3), the contents of the file binds mavenLocal to the location of my repo.
However, this doesn't solve everything. My repo is located in c:/dev/repo and the MavenLocalRepoResolver still doesn't load artifacts that are present there (e.g. lang-rhino). I'll continue the investigation ...
However, it would be great if anyone could:
a) confirm the above behaviour, with non standard repo locations
b) let me know if this is bug and if I should raise a BZ
c) share any other workarounds that work better than the above
Cheers,
Fuzz.