Reputation: 31
I have a problem with maven being unable to resolve a dependency that I need help with.
I am using maven 3.0.5 to build a project in electriccommander. The project has jna as dependency and it looks like this in the pom:
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.1.0</version>
<scope>test</scope>
</dependency>
The relevant repository is also added in the pom and the repository has both the pom and jar file for jna in http://url/content/groups/release-build-repos/net/java/dev/jna/jna/4.1.0/
When building the project it however fails with this message:
!ENTRY org.eclipse.osgi 2 0 2016-07-21 05:28:44.384
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2016-07-21 05:28:44.384
!MESSAGE Bundle initial@reference:file:plugins/net.java.dev.jna/jna-4.1.0.jar/ was not resolved.
during the junit test run. Building with -DskipTests works fine though.
However in the output of the failing build it tells me that it is successfully downloading the relevant jar and pom file for dna:
Downloaded: http://url/content/groups/release-build-repos/net/java/dev/jna/jna/4.1.0/jna-4.1.0.pom (2 KB at 26.5 KB/sec)
I get both the Downloading and Downloaded message for the pom and jar file.
So far I've tried a different maven version (3.2.5) as well as changing the scope of the dependency in the pom and completely removing the whole config and workspace and rebuilding from scratch neither of which had any success.
Is there anything I am missing that would cause that? Thanks
Upvotes: 2
Views: 7951
Reputation: 3295
I think that maven has resolved the dependency but it has not been made available to the OSGI framework started by the test.
How to include dependencies appears to depend on how you are building the plugin.
Upvotes: 0
Reputation: 1807
Try deleting that artifact directory under ~/.m2/ directory and run the following command :
mvn -U clean {install/deploy} -DskipTests
Upvotes: 1
Reputation: 1
Have you tried deleting the .m2 folder on your machine and rebuilding the project? There have been times when I've had similar errors and this has resolved some of them.
Upvotes: 0