Maven尝试解决依赖关系时出错,无法解决

时间:2018-12-20 12:20:41

标签: java maven

我想在我的Maven中包含一些来自ping federate的库,我有jar文件,并且我将其导入了lib文件夹。我在.m2中有信息,但是当我与Maven运行pom时,我会告诉我下一个:

这是我的错误:

[ERROR] Failed to execute goal on project identity.provider.attributevalidator: Could not resolve dependencies for project identity.provider.attributevalidator:identity.provider.attributevalidator:jar:1.0.0: The following artifacts could not be resolved: pingfederate:pf-commons:jar:9.1.1.0, pingfederate:pf-protocolengine:jar:9.1.1.0, com.unboundid.components:unboundid-ldapsdk:jar:1.0.0: Failure to find pingfederate:pf-commons:jar:9.1.1.0 in file://C:\Users\CesarMor\Documents\César\Kharon\identity.provider.plugins\Identity.Provider.Plugins\Identity.Provider.AttributeValidator/lib was cached in the local repository, resolution will not be reattempted until the update interval of pingfederate has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

在这里我们可以看到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>identity.provider.attributevalidator</groupId>
       <artifactId>identity.provider.attributevalidator</artifactId>
       <version>1.0.0</version>
       <name>[Kharon] LDAP Attribute Validator</name>      
       <properties>
             <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
             <project.reporting.outputEncoding>ISO-8859-1</project.reporting.outputEncoding>
             <javac.source>1.7</javac.source>
             <javac.target>1.7</javac.target>
             <jar.to.copy>target/${project.artifactId}</jar.to.copy>
             <cobertura.version>2.1.1</cobertura.version>
       </properties>
       <repositories>
      <repository>
        <id>pingfederate</id>
        <name>pingfederate</name>
        <url>file://${project.basedir}/lib</url>
      </repository>
    </repositories>
       <dependencies>

             <dependency>
                    <groupId>commons-lang</groupId>
                    <artifactId>commons-lang</artifactId>
                    <version>2.4</version>
             </dependency>

             <dependency>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                    <version>1.2</version>
             </dependency>

             <dependency>
                    <groupId>com.unboundid.components</groupId>
                    <artifactId>json</artifactId>
                    <version>1.0.0</version>
             </dependency>

             <dependency>
                    <groupId>pingfederate</groupId>
                    <artifactId>pf-commons</artifactId>
                    <version>9.1.1.0</version>
                    <scope>provided</scope>
            </dependency>

             <dependency>
                    <groupId>pingfederate</groupId>
                    <artifactId>pf-protocolengine</artifactId>
                    <version>9.1.1.0</version>
                    <scope>provided</scope>
             </dependency>

             <dependency>
                    <groupId>com.unboundid.components</groupId>
                    <artifactId>unboundid-ldapsdk</artifactId>
                    <version>1.0.0</version>
                    <scope>provided</scope>
             </dependency>

       </dependencies>

       <build>             
             <pluginManagement>
                    <plugins>
                           <plugin>
                                  <groupId>org.apache.maven.plugins</groupId>
                                  <artifactId>maven-compiler-plugin</artifactId>
                                  <version>2.5.1</version>
                                  <configuration>
                                        <source>${javac.source}</source>
                                        <target>${javac.target}</target>
                                  </configuration>
                           </plugin>
                    </plugins>
             </pluginManagement>
       </build>
</project>

1 个答案:

答案 0 :(得分:0)

您需要实际检查Identity jar的版本是否与Java版本兼容。如果可以确定,则可以在不使用maven配置的情况下尝试该项目。如果所有方法都比尝试清除maven .m2文件夹好多次,则maven会将jar列表保留在缓存中,并且不会加载较新的jar。