Maven OpenSAML依赖问题

Cra*_*aig 6 dependencies maven opensaml

我被分配了一个任务,在我的公司和客户之间实施SAML.我正在考虑使用OpenSAML,但我正在努力建立maven项目.

我添加了依赖项:

<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml</artifactId>
<version>2.5.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

但是pom文件有一个错误:缺少工件xerces:xml-apis:jar:1.4.01

我无法在maven存储库中找到这种依赖.检查OpenSAML站点时,它指出:

在基于Maven的项目中使用OpenSAML

以下是在基于Maven的项目中使用OpenSAML所需的信息.Maven存储库: https://build.shibboleth.net/nexus/content/repositories/releases组ID:org.opensaml工件ID:opensaml

但是当我在我的pom文件中配置该存储库时,它仍然无法找到依赖项.

<repositories>
    <repository>
      <id>org.opensaml</id>
      <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
    </repository>
 </repositories>
Run Code Online (Sandbox Code Playgroud)

有没有人在Maven中设置OpenSAML可以提供帮助?

Yog*_*wla 6

您是否还从存储库将 xmltooling 和 openws 依赖项添加到您的 POM 文件中:

https://build.shibboleth.net/nexus/content/repositories/releases/org/opensaml/

<dependency>
<groupId>org.opensaml</groupId>
<artifactId>xmltooling</artifactId>
<version>1.3.2</version>
</dependency>

 <dependency>
<groupId>org.opensaml</groupId>
<artifactId>openws</artifactId>
<version>1.4.2</version>
 </dependency>
Run Code Online (Sandbox Code Playgroud)

xmltooling 应该具有缺少的 xerces xml-api。

谢谢,约格什

  • 为了解决我的问题,我使用了 Maven 中的 opensaml、xmltooling 和 openws 依赖项的三个不同版本,并且不依赖于 xerces。依赖项为: &lt;dependency&gt; &lt;groupId&gt;org.opensaml&lt;/groupId&gt; &lt;artifactId&gt;opensaml&lt;/artifactId&gt; &lt;version&gt;2.5.1-1&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.opensaml &lt;/groupId&gt; &lt;artifactId&gt;openws&lt;/artifactId&gt; &lt;版本&gt;1.4.2-1&lt;/version&gt; &lt;/dependency&gt; &lt;依赖关系&gt; &lt;groupId&gt;org.opensaml&lt;/groupId&gt; &lt;artifactId&gt;xmltooling&lt;/artifactId&gt; &lt;版本&gt;1.3.2-1&lt;/版本&gt;&lt;/依赖&gt; (4认同)