I've imported maven multimodule project and some transitive dependencies are not resolved. This same project builds in Jenkins/Eclipse/Console.
I've tried two import each project separately, and also to import only parent pom - both are not working.
I have following structure: Project A
and Project B
have common parent and both are defined as modules in this parent. Project A
contains as dependency jackon-jar, Project B
does not have it. Project A
contains jackson-jar in default scope - jar is visible during compilation and tests are running. Now Project B
imports Project A
and also uses jackson-jar - and here is the problem - jackson-jar in not visible in Project B
:( When I specify it explicitly in Project B
all works fine, but it should come automatically as transitive dependency from Project A
......
Is this common problem? Is there workaround?
Here are POM examples:
Parent:
<project ....>
<modelVersion>4.0.0</modelVersion>
<version>1.0-SNAPSHOT</version>
<groupId>miklas.test</groupId>
<artifactId>my-parent</artifactId>
<packaging>pom</packaging>
<modules>
<module>my-project-a</module>
<module>my-project-b</module>
<module>my-project-c</module>
</modules>
</project>
Project-A
<project ....>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>miklas.test</groupId>
<artifactId>my-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>my-project-a</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>2.3.4.Final</version>
</dependency>
</dependencies>
</project>
Project-B
<project >
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>miklas.test</groupId>
<artifactId>my-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>my-project-b</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>miklas.test</groupId>
<artifactId>my-project-a</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
Below is also the screenshot from my real project - this would be Project B
from simplified example above. On the left side we can see, that resteasy-jackoson-provider
has 4 dependent jars, and on the right side there are only two. Both views are showing the same project:
Now the same screenshot from Project A
Transitive Dependencies. Maven avoids the need to discover and specify the libraries that your own dependencies require by including transitive dependencies automatically. This feature is facilitated by reading the project files of your dependencies from the remote repositories specified.
Once you identify your package to be fixed using any of the above methods, to fix the transitive dependency, you must add a dependency to the updated version of the vulnerable package by adding it to the . csproj file. i.e such a vulnerable package needs to be made a direct dependency of your main project.
This appears to be a bug in IntelliJ 12. See http://youtrack.jetbrains.com/issue/IDEA-98425 and please vote for the issue if it's important to you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With