首页 > 解决方案 > open-saml 3 缺少工件

问题描述

尝试在 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,但仍然遇到同样的问题。

标签: javaeclipsemavenopensaml

解决方案


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

  • 删除整个本地存储库(您的 .m2/repository)
  • 删除了对旧 JVM 的所有引用
  • 重启日食
  • 多次重置为java 1.8界面,当我选择Maven | 时,maven中的某些东西认为它的JVM1.5 | '更新项目...'
  • 根据容器“Maven 依赖项”引用非现有库运行Maven 构建- STS Mike Salleses 回答
    • 运行方式 | Maven 构建 | 目标'干净安装-U' | 跑

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

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


推荐阅读