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

Generate "exclusions" in POM #772

Merged
merged 1 commit into from
Jul 10, 2018
Merged

Generate "exclusions" in POM #772

merged 1 commit into from
Jul 10, 2018

Conversation

bsideup
Copy link
Member

@bsideup bsideup commented Jul 8, 2018

No description provided.

@bsideup
Copy link
Member Author

bsideup commented Jul 8, 2018

Fixes #753

@bsideup
Copy link
Member Author

bsideup commented Jul 9, 2018

Fixes #652

@dbyron0
Copy link
Contributor

dbyron0 commented Jul 9, 2018

Works for me. Thanks much.

@rnorth rnorth merged commit bc495a5 into master Jul 10, 2018
@rnorth rnorth deleted the pom_excludes branch July 10, 2018 20:41
@arnzel
Copy link
Contributor

arnzel commented Jul 11, 2018

@dbyron0 : How does your pom look like?

I get the following error

[WARNING]
Dependency convergence error for net.java.dev.jna:jna:4.5.0 paths to dependency are:
+-...
+-...
+-org.testcontainers:testcontainers:1.8.1
+-org.rnorth.visible-assertions:visible-assertions:2.1.0
+-net.java.dev.jna:jna:4.5.0
and
+...
+-...
+-org.testcontainers:testcontainers:1.8.1
+-net.java.dev.jna:jna-platform:4.5.1
+-net.java.dev.jna:jna:4.5.1

@dbyron0
Copy link
Contributor

dbyron0 commented Jul 11, 2018

The pom that $ ./gradlew testcontainers:publishToMavenLocal makes (~/.m2/repository/org/testcontainers/testcontainers/unspecified/testcontainers-unspecified.pom) has:

    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna-platform</artifactId>
      <version>4.5.1</version>
      <scope>compile</scope>
    </dependency>

and no mention of net.java.dev.jna:jna. In the project where I'm using this, I end up with:

|    +--- org.rnorth.visible-assertions:visible-assertions:2.1.0
|    |    \--- net.java.dev.jna:jna:4.5.0 -> 4.2.2

and

|    \--- net.java.dev.jna:jna-platform:4.5.1
|         \--- net.java.dev.jna:jna:4.5.1 -> 4.2.2

where the 4.2.2 comes from https://github.com/spring-projects/spring-boot/blob/v1.5.2.RELEASE/spring-boot-dependencies/pom.xml.

Can you convince maven to use 4.5.1 automatically? Or do you need a version of visible-assertions that uses 4.5.1 explicitly?

@arnzel
Copy link
Contributor

arnzel commented Jul 11, 2018

Hi @dbyron0 , thanks for the answer. Do you know how i can try to force maven to use this version automatically ? Yes the second option would also solve this problem temporarily

@dbyron0
Copy link
Contributor

dbyron0 commented Jul 11, 2018

Sorry, can't help you there.

@rnorth
Copy link
Member

rnorth commented Jul 11, 2018

Have you tried adding net.java.dev.jna:jna:4.5.1 as a direct dependency of your project (temporarily). If I remember correctly that is one way to control the version, or use dependencyManagement.

I'll happily merge rnorth/visible-assertions#9 for the medium term...

@arnzel
Copy link
Contributor

arnzel commented Jul 12, 2018

Hi @rnorth ,what i tried was this

<dependency>
            <groupId>myCompany.common.testcontainers</groupId>
            <artifactId>myCompany-testcontainers</artifactId>
            <version>0.5.15</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>net.java.dev.jna</groupId>
                    <artifactId>jna-platform</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.rnorth.visible-assertions</groupId>
                    <artifactId>visible-assertions</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna-platform</artifactId>
            <version>4.5.1</version>
        </dependency>
        <dependency>
            <groupId>org.rnorth.visible-assertions</groupId>
            <artifactId>visible-assertions</artifactId>
            <version>2.1.0</version>
            <exclusions>
                <exclusion>
                    <groupId>net.java.dev.jna</groupId>
                    <artifactId>jna-platform</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

where myCompany.common.testcontainers has a dependency to

    <groupId>org.testcontainers</groupId>
    <artifactId>testcontainers</artifactId>

But this does not work

@arnzel
Copy link
Contributor

arnzel commented Jul 15, 2018

This does works for me now. @rnorth thanks forthe tip with DependencyManagement

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>net.java.dev.jna</groupId>
                <artifactId>jna</artifactId>
                <version>4.5.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants