Friday, 15 April 2011

java - Why Maven resolver causes management dependencies errors? -


I have a project on Linux and 2 development environments at 1 Windows and 1.
So everything works on Windows, but not on Linux

In my POM, I have defined management dependencies like this:

  & lt; Dependency Management & gt; & Lt; Dependency & gt; & Lt; Dependency & gt; & Lt; Group & gt; Org.wildfly.bom & lt; / Group & gt; & Lt; ArtifactId & gt; Jboss-javaee-7.0-plus-all & lt; / ArtifactId> & Lt; Version & gt; $ {Version.org.wildfly} & lt; / Edition & gt; & Lt; Type & gt; Pom & lt; / Type & gt; & Lt; Scope & gt; Import & lt; / Scope & gt; & Lt; / Dependencies & gt; ...... & lt; / Dependency Management & gt;  

I use aquallion to run my unit tests and the deployment method loads dependence from POM:

  Poiwodersolivestation palm = Maven. Resolor (). Offline () .loadPomFromFile ("pom.xml"); WebArchive arch = ShrinkWrap .create (WebArchive.class, "test.war") ...... addAsLibraries (pom.importRuntimeDependencies (). Resolution (). WithTransitivity (.). AsFile ());  

However, the LoadPomFromFile method throws an invalid configuration file exception:

[error] Non-resolvable import for POM: org.wildfly.bom Failed to resolve POM: Jboss-javaee-7.0-with-all: 8.2.0. Due to the final repository system is offline, but artistry org.wildfly.bom:jboss-javaee-7.0-with-all:pom:8.2.0 Finale is available in local stores @ Com.my.package: my .projet: 0.0.1 -SNAPSHOT, /home/workspace/My_projet/pom.xml

Obviously, not all management dependencies are resolved, why?

Your local repo also configures Maven to work offline, so there is no way to solve the problem and it fails.

The problem is that you configure Maven to look at a special local test repo instead of your tests, the default $ HOME / .m2 / repository / .

To fix the problem, make sure that Maven appears at the place where you expect it.


No comments:

Post a Comment