未找到 Spring security OpenSAML 4.1.1 工件

发布于 2025-01-10 15:59:35 字数 8143 浏览 0 评论 0原文

我有一个 Maven 多模块项目,在 SAML 2.0 场景中使用 Spring Boot 2.6.4 和 spring security。

据我所知,spring 使用 opensaml,更准确地说是 OpenSAML 4.1.1,

我将此依赖项添加到我的 SAML Maven 模块的 pom 中:

<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-core</artifactId>
  <version>4.1.1</version>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-saml-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-saml-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-security-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-security-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-profile-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-messaging-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-messaging-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xmlsec-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xmlsec-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-soap-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-soap-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xacml-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xacml-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xacml-saml-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xacml-saml-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>

为了解决我的父 pom 中的上述依赖项,我添加了以下存储库:

<repositories>
    <repository>
        <id>shibboleth_repository</id>
        <name>Shibboleth Maven Repository</name>
        <url>https://build.shibboleth.net/nexus/content/repositories/releases/</url>
    </repository>
    <repository>
        <id>shibboleth_repository_2</id>
        <name>Shibboleth Maven Repository (https://mvnrepository.com/artifact/org.opensaml/opensaml-core/4.1.1)</name>
        <url>https://build.shibboleth.net/maven/releases/</url>
    </repository>
    <repository>
        <id>mule_soft</id>
        <name>Mule Soft Maven Repository</name>
        <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
    </repository>       
</repositories>

到目前为止一切顺利。当我执行 Maven clean install 命令 mvn clean install 时,一切正常,构建正确结束

当我尝试构建 Maven 站点时 (mvn clean install site:site site:stage -DskipTests) 我收到以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.10.0:site (default-cli) on project sael.module: Execution default-cli of goal org.apache.maven.plugins:maven-site-plugin:3.10.0:site failed: org.apache.maven.reporting.MavenReportException: org.eclipse.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: org.opensaml:opensaml-core:jar:4.1.1, org.opensaml:opensaml-saml-api:jar:4.1.1, org.opensaml:opensaml-saml-impl:jar:4.1.1, org.opensaml:opensaml-security-api:jar:4.1.1, org.opensaml:opensaml-security-impl:jar:4.1.1, org.opensaml:opensaml-profile-api:jar:4.1.1, org.opensaml:opensaml-messaging-api:jar:4.1.1, org.opensaml:opensaml-messaging-impl:jar:4.1.1, org.opensaml:opensaml-xmlsec-api:jar:4.1.1, org.opensaml:opensaml-xmlsec-impl:jar:4.1.1, org.opensaml:opensaml-soap-api:jar:4.1.1, org.opensaml:opensaml-soap-impl:jar:4.1.1, org.opensaml:opensaml-xacml-api:jar:4.1.1, org.opensaml:opensaml-xacml-impl:jar:4.1.1, org.opensaml:opensaml-xacml-saml-api:jar:4.1.1, org.opensaml:opensaml-xacml-saml-impl:jar:4.1.1: Could not find artifact org.opensaml:opensaml-core:jar:4.1.1 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

为什么会发生此错误以及如何修复它?

如果找不到库,则应该始终找不到它们......不仅仅是在网站生成期间。

I have a Maven multi module project where I'm using Spring Boot 2.6.4 and spring security in a SAML 2.0 scenario.

As far as I know spring uses opensaml and more exactly OpenSAML 4.1.1

I added this dependencies to the pom of my SAML Maven module:

<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-core</artifactId>
  <version>4.1.1</version>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-saml-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-saml-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-security-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-security-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-profile-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-messaging-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-messaging-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xmlsec-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xmlsec-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-soap-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-soap-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xacml-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xacml-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xacml-saml-api</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.opensaml</groupId>
  <artifactId>opensaml-xacml-saml-impl</artifactId>
  <version>4.1.1</version>
  <exclusions>
    <exclusion>
      <artifactId>*</artifactId>
      <groupId>*</groupId>
    </exclusion>
  </exclusions>
</dependency>

In order to resolve the above dependency in my parent pom I added the following repositories:

<repositories>
    <repository>
        <id>shibboleth_repository</id>
        <name>Shibboleth Maven Repository</name>
        <url>https://build.shibboleth.net/nexus/content/repositories/releases/</url>
    </repository>
    <repository>
        <id>shibboleth_repository_2</id>
        <name>Shibboleth Maven Repository (https://mvnrepository.com/artifact/org.opensaml/opensaml-core/4.1.1)</name>
        <url>https://build.shibboleth.net/maven/releases/</url>
    </repository>
    <repository>
        <id>mule_soft</id>
        <name>Mule Soft Maven Repository</name>
        <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
    </repository>       
</repositories>

So far so good. When I execute Maven clean install command mvn clean install all works good and the build ends correctly

When I try to build the Maven site (mvn clean install site:site site:stage -DskipTests) I got the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.10.0:site (default-cli) on project sael.module: Execution default-cli of goal org.apache.maven.plugins:maven-site-plugin:3.10.0:site failed: org.apache.maven.reporting.MavenReportException: org.eclipse.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: org.opensaml:opensaml-core:jar:4.1.1, org.opensaml:opensaml-saml-api:jar:4.1.1, org.opensaml:opensaml-saml-impl:jar:4.1.1, org.opensaml:opensaml-security-api:jar:4.1.1, org.opensaml:opensaml-security-impl:jar:4.1.1, org.opensaml:opensaml-profile-api:jar:4.1.1, org.opensaml:opensaml-messaging-api:jar:4.1.1, org.opensaml:opensaml-messaging-impl:jar:4.1.1, org.opensaml:opensaml-xmlsec-api:jar:4.1.1, org.opensaml:opensaml-xmlsec-impl:jar:4.1.1, org.opensaml:opensaml-soap-api:jar:4.1.1, org.opensaml:opensaml-soap-impl:jar:4.1.1, org.opensaml:opensaml-xacml-api:jar:4.1.1, org.opensaml:opensaml-xacml-impl:jar:4.1.1, org.opensaml:opensaml-xacml-saml-api:jar:4.1.1, org.opensaml:opensaml-xacml-saml-impl:jar:4.1.1: Could not find artifact org.opensaml:opensaml-core:jar:4.1.1 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

Why does this error occur and how can I fix it?

If libraries are not found they should always be not found... Not only during the site generation.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

杀お生予夺 2025-01-17 15:59:35

我刚刚在使用 org.springframework.security:spring-security-saml2-service-provider 时遇到了升级到 Spring Boot 3 的情况。

我搜索了 org.opensaml:opensaml-core:4.1.1 并找到了该版本的 MVN 存储库索引 此处。在“repositories”行中,它指示具有此版本的唯一存储库是 Shibboleth 存储库,位于 https://build.shibboleth.net/maven/releases/。
图像MVN 存储库站点

我在通常的 Maven Central 存储库之后添加了该存储库,Gradle 能够找到丢失的依赖项。

I just encountered this upgrading to Spring Boot 3 while using org.springframework.security:spring-security-saml2-service-provider.

I searched for org.opensaml:opensaml-core:4.1.1 and found the MVN Repository index for that version here. In the "repositories" row, it indicates the only repository that has this version is the Shibboleth repository, located at https://build.shibboleth.net/maven/releases/.
image of the MVN Repository site

I added that repository after the usual Maven Central repo and Gradle was able to find the missing dependency.

何以笙箫默 2025-01-17 15:59:35

我知道这已经两个月了,但我今天遇到了同样的事情,我想分享一下对我有用的东西。我一月份参与了一个使用 OpenSaml 4.1.1 的项目,今天我开始了一个新项目,并在我的 pom 中引入了类似的依赖项,该依赖项也表示无法找到工件。除了像原始海报一样在存储库部分添加 shibboleth 存储库之外,我还添加了与 pluginRepositories 相同的存储库,这使得 mvn clean install site 命令能够成功处理。 POM 片段如下所示:

    <project>
        <!-- other pom elements.... -->    
        <repositories>
            <repository>
                <id>shibboleth_repository</id>
                <name>Shibboleth Maven Repository</name>
                <url>https://build.shibboleth.net/nexus/content/repositories/releases/</url>
            </repository>
            <repository>
                <id>shibboleth_repository_2</id>
                <name>Shibboleth Maven Repository (https://mvnrepository.com/artifact/org.opensaml/opensaml-core/4.1.1)</name>
                <url>https://build.shibboleth.net/maven/releases/</url>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>shibboleth_repository</id>
                <name>Shibboleth Maven Repository</name>
                <url>https://build.shibboleth.net/nexus/content/repositories/releases/</url>
            </pluginRepository>
            <pluginRepository>
                <id>shibboleth_repository_2</id>
                <name>Shibboleth Maven Repository (https://mvnrepository.com/artifact/org.opensaml/opensaml-core/4.1.1)</name>
                <url>https://build.shibboleth.net/maven/releases/</url>
            </pluginRepository>
        </pluginRepositories>
    </project>

希望对遇到此问题的其他人有所帮助!

I know this is 2 months old, but I ran into the same thing just today and thought I would share what worked for me. I worked on a project in January that used OpenSaml 4.1.1, and I started a new one today and brought in the similar dependencies in my pom which also said the artifacts could not be found. In addition to adding the shibboleth repositories in the repositories section as the original poster did, I also added the same repositories as pluginRepositories and that allowed the mvn clean install site command to process successfully. The POM snippet looks like:

    <project>
        <!-- other pom elements.... -->    
        <repositories>
            <repository>
                <id>shibboleth_repository</id>
                <name>Shibboleth Maven Repository</name>
                <url>https://build.shibboleth.net/nexus/content/repositories/releases/</url>
            </repository>
            <repository>
                <id>shibboleth_repository_2</id>
                <name>Shibboleth Maven Repository (https://mvnrepository.com/artifact/org.opensaml/opensaml-core/4.1.1)</name>
                <url>https://build.shibboleth.net/maven/releases/</url>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>shibboleth_repository</id>
                <name>Shibboleth Maven Repository</name>
                <url>https://build.shibboleth.net/nexus/content/repositories/releases/</url>
            </pluginRepository>
            <pluginRepository>
                <id>shibboleth_repository_2</id>
                <name>Shibboleth Maven Repository (https://mvnrepository.com/artifact/org.opensaml/opensaml-core/4.1.1)</name>
                <url>https://build.shibboleth.net/maven/releases/</url>
            </pluginRepository>
        </pluginRepositories>
    </project>

Hope that helps anyone else that runs into it!

街角迷惘 2025-01-17 15:59:35

在 gradle 中,尝试:

repositories
    mavenCentral()
    maven {
        url "https://build.shibboleth.net/maven/releases/"
    }
}

At gradle, try:

repositories
    mavenCentral()
    maven {
        url "https://build.shibboleth.net/maven/releases/"
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文