repos.txt not loaded whilst running maven integration tests

158 views
Skip to first unread message

Farzad Pezeshkpour

unread,
Dec 31, 2013, 5:58:41 AM12/31/13
to ve...@googlegroups.com
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:
~/.m2/repository

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.

Tim Fox

unread,
Jan 6, 2014, 7:53:38 AM1/6/14
to ve...@googlegroups.com
You should also be able to add the repos.txt to your src/main/resource directory as the Vert.x maven plugin adds that to the classpath.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages