Mule OAuth2 - 无法解析 'module-security-oauth2-provider'

Mule OAuth2 - could not resolve 'module-security-oauth2-provider'

我尝试 运行 来自 mulesoft 的 'simple' 示例,但总是以以下 BUILD FAILURE

结束

Failed to execute goal on project test: Could not resolve dependencies for project XXX: Failed to collect dependencies at com.mulesoft.security:mule-module-security-oauth2-provider:jar:1.3.2: Failed to read artifact descriptor for com.mulesoft.security:mule-module-security-oauth2-provider:jar:1.3.2: Failure to find com.mulesoft.security:mule-module-security:pom:1.3.2 in http://repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of Central has elapsed or updates are forced -> [Help 1]

我的流量是

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
 xmlns:oauth2-provider="http://www.mulesoft.org/schema/mule/oauth2-provider"
 xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
 xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
 xmlns:ss="http://www.springframework.org/schema/security"
 xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/current/mule-spring-security.xsd
http://www.mulesoft.org/schema/mule/oauth2-provider http://www.mulesoft.org/schema/mule/oauth2-provider/current/mule-oauth2-provider.xsd">

 <spring:beans>
  <ss:authentication-manager id="resourceOwnerAuthenticationManager">
   <ss:authentication-provider>
    <ss:user-service id="resourceOwnerUserService">
     <ss:user name="john" password="doe" authorities="RESOURCE_OWNER" />
    </ss:user-service>
   </ss:authentication-provider>
  </ss:authentication-manager>
 </spring:beans>

 <mule-ss:security-manager>
  <mule-ss:delegate-security-provider
   name="resourceOwnerSecurityProvider" delegate-ref="resourceOwnerAuthenticationManager" />
 </mule-ss:security-manager>

 <oauth2-provider:config name="oauth2ProviderCode"
  providerName="SampleAPI" port="8081" authorizationEndpointPath="sampleapi/api/authorize"
  accessTokenEndpointPath="sampleapi/api/token"
  resourceOwnerSecurityProvider-ref="resourceOwnerSecurityProvider"
  scopes="READ_RESOURCE POST_RESOURCE" doc:name="OAuth provider module">
  <oauth2-provider:clients>
   <oauth2-provider:client clientId="myclientid"
    secret="myclientsecret" type="CONFIDENTIAL" clientName="Mule Bookstore"
    description="Mule-powered On-line Bookstore">
    <oauth2-provider:redirect-uris>
     <oauth2-provider:redirect-uri>http://localhost*</oauth2-provider:redirect-uri>
    </oauth2-provider:redirect-uris>
    <oauth2-provider:authorized-grant-types>
     <oauth2-provider:authorized-grant-type>AUTHORIZATION_CODE</oauth2-provider:authorized-grant-type>
    </oauth2-provider:authorized-grant-types>
    <oauth2-provider:scopes>
     <oauth2-provider:scope>READ_RESOURCE</oauth2-provider:scope>
     <oauth2-provider:scope>POST_RESOURCE</oauth2-provider:scope>
    </oauth2-provider:scopes>
   </oauth2-provider:client>
  </oauth2-provider:clients>
 </oauth2-provider:config>
 <http:listener-config name="HTTP_Listener_Configuration"
  host="localhost" port="8081" doc:name="HTTP Listener Configuration" />
 <flow name="protected-authcode">
  <http:listener config-ref="HTTP_Listener_Configuration"
   path="/resources" doc:name="HTTP" />
  <oauth2-provider:validate config-ref="oauth2ProviderCode"
   doc:name="Validate Token" scopes="READ_RESOURCE" />
  <set-payload
   value="#[ ['name' : 'payroll', 'uri' : 'http://localhost:8081/resources/payroll'] ]"
   doc:name="Set Payload" />
  <json:object-to-json-transformer
   doc:name="Object to JSON" />
 </flow>


 <!-- THIS FLOW IS JUST AN AID TO HELP MANUAL TESTING OF THE OAUTH2 DANCE -->
 <flow name="redirectFlow">
  <http:listener config-ref="HTTP_Listener_Configuration"
   path="/redirect" doc:name="HTTP" />
  <set-property value="302" propertyName="http.status"
   doc:name="Property" />
  <set-property propertyName="Location"
   value="http://localhost:8081/sampleapi/api/token?grant_type=authorization_code&amp;&amp;client_id=myclientid&amp;client_secret=myclientsecret&amp;code=#[message.inboundProperties.code]
     &amp;redirect_uri=http://localhost:8081/redirect"
   doc:name="Property" />
 </flow>
</mule>

在我的 POM 文件中,我有以下存储库:

...  
<dependency>
   <groupId>com.mulesoft.security</groupId>
   <artifactId>mule-module-security-oauth2-provider</artifactId>
   <version>1.3.2</version>
  </dependency>
...

<repositories>
  <repository>
   <id>Central</id>
   <name>Central</name>
   <url>http://repo1.maven.org/maven2/</url>
   <layout>default</layout>
  </repository>
  <repository>
   <id>mulesoft-releases</id>
   <name>MuleSoft Releases Repository</name>
   <url>http://repository.mulesoft.org/releases/</url>
   <layout>default</layout>
  </repository>
  <repository>
   <id>mulesoft-snapshots</id>
   <name>MuleSoft Snapshots Repository</name>
   <url>http://repository.mulesoft.org/snapshots/</url>
   <layout>default</layout>
  </repository>
  <repository>
   <id>mulesoft-releases2</id>
   <name>MuleSoft Releases Repository2</name>
   <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
   <layout>default</layout>
  </repository>
 </repositories>

这个安全模块属于 Anypoint Enterprise Security,我想记住 Mule 有一个用于企业事物的安全存储库。难道我必须联系 Mule 才能访问吗? 但另一方面,在他们的网站和给定的示例中没有关于此的信息。有人知道我可以尝试解决这个问题并成功 运行 这个例子吗?

是的,有一个 EE 存储库需要 username/password 组合,它将由 Mulesoft 提供。如果您是客户,可以通过支持门户联系他们。

        <repository>
            <id>mulesoft-ee-release</id>
            <name>Mulesoft EE</name>
            <url>https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/</url>
        </repository>

然后在您的 Maven settings.xml 中设置 username/password。