Issue with Maven war Plugin - java

I am using maven to package my war file. I have some dependencies with provided as scope. When i do a maven clean install, the war is created successfully, but the transitive dependencies of the jars with scope as provided are included in my lib directory. Is there any way to remove them ?
Example scenario: Below is one of my dependency in pom
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
<scope>provided</scope>
</dependency>
this one is including the jar activation-1.1.jar. Also the dependency tree for resteasy-jaxrs is like below.
[INFO] +- org.jboss.resteasy:resteasy-jaxrs:jar:2.3.6.Final:provided
[INFO] | +- org.jboss.resteasy:jaxrs-api:jar:2.3.6.Final:provided
[INFO] | +- javax.annotation:jsr250-api:jar:1.0:compile
[INFO] | +- javax.activation:activation:jar:1.1:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.1.2:provided
[INFO] | | \- org.apache.httpcomponents:httpcore:jar:4.1.2:provided
[INFO] | \- net.jcip:jcip-annotations:jar:1.0:compile

The easiest way is to create a <dependencyManagement> tag and put the sub-dependency inside and set the scope to provided:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
That way the scope of your transitive-dependency is overwritten:
[INFO] | +- javax.annotation:jsr250-api:jar:1.0:provided (scope managed from compile)
[INFO] | +- javax.activation:activation:jar:1.1:provided (scope managed from compile)
Be sure to do a Maven-> Update Project and check the Force Update checkbox before checking the dependency:tree.

The above mentioned solution is not possible in case i have so many transitive dependencies coming in my lib. Finally got the maven exclusion which is working fine.
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>

Related

How to resolve "scanned from multiple locations" warnings caused by jersey

I have a Google App Engine project that I'm building with maven. I added jax-rs to it by adding the following bom to my pom:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bom</artifactId>
<version>0.73.0-alpha</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>2.27</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Also I needed these three dependencies:
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<exclusions>
<exclusion><!-- Exclude this repackaged javax.inject. -->
<groupId>org.glassfish.hk2.external</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<exclusions>
<exclusion><!-- Exclude this repackaged javax.inject. -->
<groupId>org.glassfish.hk2.external</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
</dependency>
As you can see I have excluded some of the repackaged to get rid of some runtime warnings about duplicate classes being found. To be clear, every rest call using the jax-rs api's works fine and I don't see the warnings on google app engine itself, just locally. (full code at https://github.com/Leejjon/blindpool) When running it on the local jetty runtime using 'mvn appengine:run', it still complains about every json related class in the javax.json-1.1.jar and javax.json-api-1.1.jar.
Example
[INFO] GCLOUD: 2018-12-11 22:01:13.495:WARN:oeja.AnnotationParser:main: Unknown asm implementation version, assuming version 393216
[INFO] GCLOUD: 2018-12-11 22:01:13.780:WARN:oeja.AnnotationParser:qtp551734240-15: javax.json.Json scanned from multiple locations: jar:file:///C:/Users/Leejjon/IdeaProjects/Blindpool/backend/target/blindpool-1.0-SNAPSHOT/WEB-INF/lib/javax.json-api-1.1.jar!/javax/json/Json.class, jar:file:///C:/Users/Leejjon/IdeaProjects/Blindpool/backend/target/blindpool-1.0-SNAPSHOT/WEB-INF/lib/javax.json-1.1.jar!/javax/json/Json.class
When I look at my 'mvn dependency:tree' output I can see that my 'jersey-media-json-binding' dependency has both javax.json-1.1 and javax.json-api-1.1 in it. And they have classes that have the same names.
[INFO] +- org.glassfish.jersey.media:jersey-media-json-binding:jar:2.27:compile
[INFO] | +- org.glassfish:javax.json:jar:1.1:compile
[INFO] | +- org.eclipse:yasson:jar:1.0:compile
[INFO] | | +- javax.json:javax.json-api:jar:1.1:compile
[INFO] | | \- javax.enterprise:cdi-api:jar:2.0:compile
[INFO] | | +- javax.el:javax.el-api:jar:3.0.0:compile
[INFO] | | \- javax.interceptor:javax.interceptor-api:jar:1.2:compile
[INFO] | \- javax.json.bind:javax.json.bind-api:jar:1.0:compile
Full dependency tree (https://pastebin.com/JfwzavDX).
I have tried to exclude them but failed to do so in a way that didn't cause me to actually break my web app and get errors like: javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.ExceptionInInitializerError
TLDR: What dependency to I exclude here to get rid of the duplicate location warning thrown by the 'mvn appengine:run' command without breaking the jax-rs application.
Hoping for that jax-rs/maven/jetty/jersey/google app engine god to pass by and point me in the right direction :)

Changing from info.cukes to io.cucumber with testNG Maven. Throwing runtime error

I have a selenium cucumber testng framework using maven. I was hoping to get step descriptions when I run my cucumber tests with testng. It was an old project so I have changed my dependencies from info.cukes to the latest version of io.cucumber. However it seems to be throwing out errors whenever I run the runner test file.
java.lang.NoSuchMethodError: cucumber.runtime.RuntimeOptions.getPluginFormatterNames()Ljava/util/List;
at cucumber.runtime.formatter.Plugins.createPlugins(Plugins.java:64)
at cucumber.runtime.formatter.Plugins.<init>(Plugins.java:37)
at cucumber.api.testng.TestNGCucumberRunner.<init>(TestNGCucumberRunner.java:56)
at cucumber.api.testng.AbstractTestNGCucumberTests.setUpClass(AbstractTestNGCucumberTests.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:168)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
I have the following maven dependencies but have no idea if it is a dependency that I am missing to get the test to run? Any Help would be greatly appreciated. As when I have search this issue it seems that it is mostly solved by having the same version dependencies of all the io.cucumber files which I do.
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-junit -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.2.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-java -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-testng -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>4.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.21.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/tag-expressions -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>tag-expressions</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-expressions -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-expressions</artifactId>
<version>6.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/messages -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>messages</artifactId>
<version>2.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java8 -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java8</artifactId>
<version>4.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.mkolisnyk/cucumber-report-generator -->
<dependency>
<groupId>com.github.mkolisnyk</groupId>
<artifactId>cucumber-report-generator</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/gherkin -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>gherkin</artifactId>
<version>6.0.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/info.cukes/gherkin -->
<!--<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.12.2</version>
<scope>provided</scope>
</dependency>-->
<!-- https://mvnrepository.com/artifact/info.cukes/cucumber-core -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<version>4.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/ru.sbtqa.tag/cucumber-runner -->
<dependency>
<groupId>ru.sbtqa.tag</groupId>
<artifactId>cucumber-runner</artifactId>
<version>1.0.7</version>
</dependency>
Check maven pom.xml cucumber-core cucumber-java cucumber-junit
These files should have the same version. In your example, cucumber-java artifact id has a different version than the rest.
Try changing it.
Find below some snippets to break down the problem
check if there is a transitive dependency to groupid info.cukes
$ mvn dependency:tree | grep 'info.cuke'
[INFO] | +- info.cukes:cucumber-junit:jar:1.2.5:compile
[INFO] | | \- info.cukes:cucumber-core:jar:1.2.5:compile
[INFO] | | +- info.cukes:cucumber-html:jar:0.2.3:compile
[INFO] | | \- info.cukes:cucumber-jvm-deps:jar:1.0.5:compile
[INFO] | +- info.cukes:cucumber-testng:jar:1.2.5:compile
[INFO] | +- info.cukes:cucumber-java:jar:1.2.5:compile
[INFO] | +- info.cukes:gherkin:jar:2.12.2:compile
when checking the full output reveals which of your dependency depends on it
...
[INFO] +- com.github.mkolisnyk:cucumber-report-generator:jar:1.3:compile
...
[INFO] | +- info.cukes:cucumber-junit:jar:1.2.5:compile
...
[INFO] | +- info.cukes:cucumber-testng:jar:1.2.5:compile
...
[INFO] \- ru.sbtqa.tag:cucumber-runner:jar:1.0.7:compile
[INFO] \- ru.sbtqa.tag:cucumber-runner:jar:1.0.7:compile
[INFO] +- ru.yandex.qatools.allure:allure-cucumber-jvm-adaptor:jar:1.6.4:compile
...
[INFO] | +- info.cukes:cucumber-core:jar:1.2.5:compile
...
[INFO] | +- info.cukes:cucumber-java:jar:1.2.5:compile
[INFO] | +- info.cukes:gherkin:jar:2.12.2:compile
...
[INFO] +- info.cukes:cucumber-junit:jar:1.2.5:compile
as there might be an overlapping of classed with the same qualified name, exclude those transient dependencies in the pom.xml
<dependency>
<groupId>com.github.mkolisnyk</groupId>
<artifactId>cucumber-report-generator</artifactId>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>info.cukes</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
running the test again it throws an exception
java.lang.NoClassDefFoundError: gherkin/IGherkinDialectProvider
as we explicitly define the dependency io.cucumber:gherkin it might be related to the specified <version>, comment it out to see if another version is fetched
<!--<dependency>-->
<!--<groupId>io.cucumber</groupId>-->
<!--<artifactId>gherkin</artifactId>-->
<!--<version>6.0.14</version>-->
<!--</dependency>-->
this reveals that io.cucumber:cucumber-core:jar:4.2.0 depends on version 5.1.0 of io.cucumber:gherkin
$ mvn dependency:tree
...
[INFO] +- io.cucumber:cucumber-core:jar:4.2.0:compile
[INFO] | +- io.cucumber:cucumber-html:jar:0.2.7:compile
[INFO] | +- io.cucumber:gherkin:jar:5.1.0:compile
With those changes at least the TestNG unit test is running.
As the dependencies com.github.mkolisnyk:cucumber-report-generator and ru.sbtqa.tag:cucumber-runner depending on the info.cuke dependencies they might not work correctly anymore. To solve this kind of problem you could:
check for a newer version which might not depend on group id info.cuke
use earlier version of io.cucumber dependencies
use a more finegrained exclusion of the info.cuke dependencies, instead of excluding all artifact ids
a combination of above points
something else, depending on your use case and requirements
Maybe those steps help you to find a solution working for you.

Elastic Search 5.6.4 pom transport issue

We are pointing to Elasticsearch 5.6.4. I used below entry in pom.xml:
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>5.6.4</version>
</dependency>
When I created the dependency tree:
[INFO] +- org.elasticsearch.client:transport:jar:5.6.4:compile
[INFO] | +- org.elasticsearch:elasticsearch:jar:2.4.4:compile (version
managed from 5.6.4)
[INFO] | | +- org.apache.lucene:lucene-core:jar:5.5.2:compile
[INFO] | | +- org.apache.lucene:lucene-backward-codecs:jar:5.5.2:compile
Can someone help to resolve this. I need elasticsearch-5.6.4.jar, but I am getting run time issues.
<pre>
this resolved my issue
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>5.6.4</version>
</dependency>
</dependencies>
</dependencyManagement>
</pre>

Why are my nested maven dependencies not showing up when compiling

I have a library named my-library which I packaged with Maven and stored on a private Nexus repository. It compiles and gets uploaded to my repo correctly and has the following dependencies specified in its pom.xml file:
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.13</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
I am including this dependency in another project, my-child-project, using the following pom.xml blocks:
<repositories>
<repository>
<id>MyRepo</id>
<name>My Maven Repository</name>
<url>http://localhost:8081/nexus/repo</url>
</repository>
</repositories>
...
<dependencies>
<dependency>
<groupId>com.my.group</groupId>
<artifactId>my-library</artifactId>
<scope>compile</scope>
<version>1.0.0</version>
</dependency>
</dependencies>
When i run mvn clean install in my-child-project, it appears that maven is able to find and download my-library but not the nested dependency on com.google.protobuf unless i include it explicitly in the pom.xml for my-child-project. I can confirm that Maven can see my dependency but not the nested one when running mvn dependency:tree:
...
[INFO] +- org.springframework.data:spring-data-redis:jar:1.7.1.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-keyvalue:jar:1.1.1.RELEASE:compile
[INFO] | \- org.springframework:spring-oxm:jar:4.2.5.RELEASE:compile
[INFO] +- redis.clients:jedis:jar:2.8.1:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided
[INFO] +- com.my.group:my-library:jar:1.0.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.4:compile
...
Is this how a nested library dependency is supposed to work? I thought nested dependencies in other dependencies are automatically resolved and downloaded by Maven in compile scope. I was hoping to only list the nested dependency in my-library and not in my-child-project but it seems that doesn't work.
First, the parent pom.xml should add dependencyManagement tag outside the dependencies tag. This is just to manage the modules dependencies in one place, but not actually import them into your project.
You still have to declare it in your child module's pom. (But you can leave out the version tag, as that will be inherited from the parent pom)
#herokingsley's answer got me to the correct configuration. I was hesitating to try it because the answer seemed to suggest that i need to redeclare the nested dependency in my child. When i finally did try it i purposely did not declare the nested dependency in my-child-project and it still worked like a charm. Here is the code that solved my problem. I changed the code in my-library to the following:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.13</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
The above change was enough as it resulted in the following output when running mvn dependency:tree:
...
[INFO] +- org.springframework.data:spring-data-redis:jar:1.7.1.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-keyvalue:jar:1.1.1.RELEASE:compile
[INFO] | \- org.springframework:spring-oxm:jar:4.2.5.RELEASE:compile
[INFO] +- redis.clients:jedis:jar:2.8.1:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:provided
[INFO] +- com.my.group:my-library:jar:1.0.0:compile
[INFO] | \- com.google.protobuf:protobuf-java:jar:3.1.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.4:compile
...

Maven transitive dependency has scope compile while when dependency has provided scope

In my project I have openejb-core dependency with scope provided. However it has transitive dependency of slf4j and its scope is compile (see screenshot). All other transitive dependencies are provided as expected.
Question: Is it bug or am I missing something?
In a sample pom I added:
<dependencies>
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-core</artifactId>
<version>4.7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Then running:
mvn dependency:tree -Dincludes=org.slf4j
The output is:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # test-junit ---
[INFO] com.sample:test-sample:jar:0.0.1-SNAPSHOT
[INFO] \- org.apache.openejb:openejb-core:jar:4.7.0:provided
[INFO] +- org.slf4j:slf4j-jdk14:jar:1.7.7:provided
[INFO] \- org.slf4j:slf4j-api:jar:1.7.7:provided
So as you can see Maven is coherent with its official documentation. The issue from your screenshot is probably on your IDE.
The table is the key point on this topic:
From it, we can see that what is transitively in scope compile or runtime goes in scope provided, what is in scope provided or test is ignored.
However, if I change my sample pom to:
<dependencies>
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-core</artifactId>
<version>4.7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
</dependencies>
And re-run the dependency tree command, the output is as following:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # test-junit ---
[INFO] com.sample:test-sample:jar:0.0.1-SNAPSHOT
[INFO] +- org.apache.openejb:openejb-core:jar:4.7.0:provided
[INFO] | \- org.slf4j:slf4j-jdk14:jar:1.7.7:provided
[INFO] \- org.slf4j:slf4j-api:jar:1.7.7:compile
Look now: it comes not as a child of the provided dependency, but at the same level.
Let's keep on.
If on my sample pom I remove the sl4f-api dependency but I add to the pom the following:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
<scope>compile</scope>
</dependency>
</dependencies>
</dependencyManagement>
And re-re-run the dependency tree command, I finally get the same as your screenshot:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # test-junit ---
[INFO] com.sample:test-sample:jar:0.0.1-SNAPSHOT
[INFO] \- org.apache.openejb:openejb-core:jar:4.7.0:provided
[INFO] +- org.slf4j:slf4j-jdk14:jar:1.7.7:provided
[INFO] \- org.slf4j:slf4j-api:jar:1.7.7:compile
Bingo: the dependencyManagement section is overriding the scope of the transitive dependency, affecting also the mediation on provided scope. This is not a bug, it's by design as in this section you define kind of governance concerning your dependencies. The diagram in this case is also correct and not misleading, since the dependency is only introduced by openejb-core which is then affected by the dependencyManagement decision to put sl4f-api in scope compile.

Categories