Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excluded transient dependencies are (sometimes?) included #19

Open
jwiklund opened this issue Jun 3, 2017 · 0 comments
Open

Excluded transient dependencies are (sometimes?) included #19

jwiklund opened this issue Jun 3, 2017 · 0 comments

Comments

@jwiklund
Copy link

jwiklund commented Jun 3, 2017

Maven exclusion doesn't work as expected (sometimes?).

Had problem with the firebase-admin that has an excluded dependency on guava-jdk5.

Steps to reproduce, use example pom with mvn dependency:tree, notice there is no reference to guava-jdk5, run java -Dcapsule.trampoline=true -jar target\example-0.0.1-SNAPSHOT-capsule.jar and see guava-jdk5-17.0.jar in the generated classpath, nb the order seems to be random since in this example the guava-21 jar comes before guava-jdk5 which doesn't cause a problem, but in my original project the jdk5 version was always before and therefor crashed the app. (I submit the bug here since the dependencies generated by the maven plugin looks correct to me, ie no guava-jdk5, but during runtime it is somehow added).

Example pom.xml

<project xmlns="http
//maven.apache.org/POM/4.0.0" xmlns
xsi="http
//www.w3.org/2001/XMLSchema-instance"
  xsi
schemaLocation="http
//maven.apache.org/POM/4.0.0 http
//maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>example</groupId>
  <artifactId>example</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>utf8</project.build.sourceEncoding>
  </properties>
  
  <dependencies>
    <dependency>
      <groupId>com.google.firebase</groupId>
      <artifactId>firebase-admin</artifactId>
      <version>5.0.0</version>
      <exclusions>
        <exclusion>
          <groupId>com.google.base</groupId>
          <artifactId>guava-jdk5</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>21.0</version>
    </dependency>
  </dependencies>
  
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <configuration>
          <mainClass>example.Main</mainClass>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.chrisdchristo</groupId>
        <artifactId>capsule-maven-plugin</artifactId>
        <version>1.5.1</version>
        <configuration>
          <execPluginConfig>root</execPluginConfig>
          <type>thin</type>
          <includeApp>true</includeApp>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant