我正在使用Nexus Repository Manager(OSS 3.0.0-03)进行存储库管理。有人可以帮我使用Rest API创建"托管" " raw"的存储库格式。我尝试过以下命令:
repository.xml
<repository>
<data>
<id>aem-demo</id>
<name>aem-demo</name>
<exposed>true</exposed>
<repoType>hosted</repoType>
<repoPolicy>Allow redeploy</repoPolicy>
<providerRole>org.sonatype.nexus.proxy.repository.Repository</providerRole>
<format>raw</format>
</data>
</repository>
Command to create the repository:
curl -i -H "Accept: application/xml" -H "Content-Type: application/xml" -f -X POST -v -d "@repository.xml" -u admin:password http://host:8081/nexus/repository
But I am facing following error:
* About to connect() to IP_ADDRESS port 8081 (#0)
* Trying IP_ADDRESS...
* Connected to IP_ADDRESS (IP_ADDRESS) port 8081 (#0)
* Server auth using Basic with user 'admin'
> POST /nexus/repository/ HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4xMjM=
> User-Agent: curl/7.29.0
> Host: IP_ADDRESS:8081
> Accept: application/xml
> Content-Type: application/xml
> Content-Length: 320
>
* upload completely sent off: 320 out of 320 bytes
* The requested URL returned error: 400 Bad Request
* Closing connection 0
curl: (22) The requested URL returned error: 400 Bad Request
Any help is highly appreciated.
Thanks,
Sanjiv
答案 0 :(得分:0)
Nexus 2.x REST API无法与Nexus 3配合使用。请参阅此处:http://books.sonatype.com/nexus-book/3.0/reference/scripting.html