Maven failing to resolve recursive dependencies with multiple repositories

前端 未结 6 1216
旧巷少年郎
旧巷少年郎 2020-12-08 15:56

I\'m new to maven so there must be something I don\'t understand. But, I\'ve added multiple repositories to resolve multiple dependencies in my POM file. For some reason i

相关标签:
6条回答
  • 2020-12-08 16:23

    Just got this problem: log4j version 1.2.15 is causing this problem. Using log4j version 1.12.16 removes this problem. see Missing artifact com.sun.jdmk:jmxtools:jar:1.2.1

    0 讨论(0)
  • 2020-12-08 16:28

    I think download jmx1.2.1 will help you :-), try upload it to your nexus

    0 讨论(0)
  • 2020-12-08 16:33

    It looks like you are running Maven 3+ and you are trying to access a legacy repository.

    One annoying but well documented change for Maven 3 was removing support for legacy repositories. You can check out this compatibility note and others here

    If you are not depending completely on Maven 3 you can reduce to Maven 2.2.1 and this legacy issue should go away or follow what the link says and create a

    Maven 2.x compatible view of the legacy repository

    0 讨论(0)
  • 2020-12-08 16:35
    You should use 2 repository like bellow:
    <repositories>
            <repository>
                <id>repository.jboss.org-public</id>
                <name>JBoss repository</name>
                <url>https://repository.jboss.org/nexus/content/groups/public</url>
            </repository>
            <repository>
                <id>maven-restlet</id>
                <name>Public online Restlet repository</name>
                <url>http://maven.restlet.org</url>
            </repository>
    </repositories>
    
    0 讨论(0)
  • 2020-12-08 16:37

    I found two solution for the problem , both are equally effective .

    1. Download jar and install locally

      mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>


    2 . Exclusion of dependencies

    `<dependency> .... <exclusions> <exclusion> <groupId> ... <artifactId>...</exclusion>`
    

    maven dependency exclusions

    0 讨论(0)
  • 2020-12-08 16:46

    I may be a little late to the party, but someone using log4j 1.2.15 may search for it in the future. The problem is resolved with this:

    <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    
    0 讨论(0)
提交回复
热议问题