【问题标题】:Missing artifact for open-saml 3open-saml 3 缺少工件
【发布时间】:2018-10-15 07:03:08
【问题描述】:

尝试在 Eclipse 中构建一个小型示例项目(尝试了 Eclipse 的火星和氧气释放)。使用 Java 1.8。当我添加 opensaml 依赖项时,它在 opensaml-saml-impl 上失败,指示:

Missing artifact org.apache.commons:commons-collections:jar:3.2.1
Missing artifact org.apache.commons:commons-lang:jar:2.6
Missing artifact org.apache.jakarta:oro:jar:2.0.8

带有以下 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>testSAML2</groupId>
  <artifactId>test.test.saml</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>abc</name>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <properties>
    <opensaml.version>3.3.0</opensaml.version>
  </properties>
      <dependencies>
        <dependency>
            <groupId>org.opensaml</groupId>
            <artifactId>opensaml-core</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>org.opensaml</groupId>
            <artifactId>opensaml-saml-api</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>org.opensaml</groupId>
            <artifactId>opensaml-saml-impl</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>org.opensaml</groupId>
            <artifactId>opensaml-messaging-api</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>org.opensaml</groupId>
            <artifactId>opensaml-messaging-impl</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>org.opensaml</groupId>
            <artifactId>opensaml-soap-api</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>org.opensaml</groupId>
            <artifactId>opensaml-soap-impl</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
         <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>1.1.7</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.1.7</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>
    </dependencies>
</project>

我尝试在底部添加一个存储库,但没有改变:

<repositories>
    <repository>
        <id>shib-release</id>
        <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
    </repository>
</repositories>

有人知道为什么吗?我尝试“更新项目...”,尝试删除/添加为 maven 项目,尝试了一个空的新项目,尝试安装氧气作为新的 ide,但仍然遇到同样的问题。

【问题讨论】:

  • 您是否尝试将那些缺少的 jar 依赖项也添加到 pom 中?
  • 是的,尝试手动添加 3.2.1 版本的 commons-collection,如错误所示。没有变化。

标签: java eclipse maven opensaml


【解决方案1】:

通过一系列步骤解决。最终,我认为最后一步是解决问题的主要步骤(maven build)。这是系列:

  • 删除整个本地存储库(您的 .m2/repository)
  • 删除了对旧版 JVM 的所有引用
  • 重启 eclipse
  • 多次重置为java 1.8界面,当我选择Maven时,maven中的某些东西认为它的JVM1.5 | '更新项目...'
  • 按照The container 'Maven Dependencies' references non existing library - STS Mike Salleses 的回答运行 Maven 构建
    • 运行为 | Maven 构建 |目标'干净安装-U' |运行

maven 构建是我从未见过的新技术。它基本上构建了包括 maven pulls 的项目,您可以以日志样式格式查看失败的详细信息。

maven 构建最终强制下载所有 jar 并编译。此时,其余的测试项目都使用干净的构建。

【讨论】:

    猜你喜欢
    • 2016-02-14
    • 1970-01-01
    • 2022-01-03
    • 2012-01-12
    • 2012-02-18
    • 2014-01-04
    • 2013-07-12
    • 1970-01-01
    • 2015-12-31
    相关资源
    最近更新 更多