Maven resolves dependecy but cannot find package / classes in it

In a special assembly of the geotools platform (actually OSGi), one of the modules compiles correctly when I try to build it separately. But when I build the whole project - it does not work at the compile stage, because it cannot find specific packages / classes. Howerver is subject to an allowed state.

here is the dependency on the pom.xml module:

 <dependency> <groupId>org.picocontainer</groupId> <artifactId>com.springsource.org.picocontainer</artifactId> <version>1.2.0</version> </dependency> 

part of the maven build error:

... \ GeoTools-OSGi \ Modules \ extension \ XSD \ XSD-kernel \ SRC \ main \ Java \ org \ GeoTools \ xs \ bindings \ XSGroupBinding.java: [19,24] org.picocon tainer package does not exist

... \ geotools-osgi \ modules \ extension \ xsd \ xsd-core \ src \ main \ java \ org \ geotools \ xml \ AbstractComplexBinding.java: [20,24] org.picocon tainer package does not exist

... \ GeoTools-OSGi \ Modules \ extension \ XSD \ XSD-kernel \ SRC \ main \ Java \ org \ GeoTools \ XML \ ComplexBinding.java: [21,24] org.picocontainer package does not exist

if I change pom.xml dependecy - it fails with some kind of “cannot resolve the package”.

The project is really large and the number of packs and child / parent priests. Therefore, I cannot post them here. So my question is: what is the possible cause of this kind of trouble? Could this be a dependency conflict between parent / child?

+8
maven dependencies osgi
source share
3 answers

Well, the actual reason was that the target computer had limited access to the Internet, so limited access to maven repositories. With some black magic, this did not fail with some “cannot download artifact” (perhaps due to the manual installation of some jar files). Thus, we got a server with normal access, configured it as a mirror, configured our maven to use a mirror, and solved this problem. Thanks to @Samuel for participating in my problem, but since I see that the problem could not be determined from the description of the problem.

+1
source share

I can see two things to try to solve this problem.

Firstly, if you go to the local .m2 repository, you will see if there are other versions of lib (however, sometimes different versions may have a different name, and therefore they are stored in a different folder, help)

You can also check what the ACTUAL dependency is used in your IDE or on the command line (mvn dependency: tree). You may need to eliminate some transitive dependency in order to stay consistent. For this I use the Eclipse plugin.

Finally, when you are sure of the addiction you are using, you can open the can and see if what you expect from it is present.

+5
source share

I had the same problem. My problem was that the dependency was installed for verification. so when i released exec: java, it could not find the class because it went out of scope.

0
source share

All Articles