0

I am using Ivy to build my project which has several components. I want to upload these components to Nexus 2.6.4

I am able to publish files to Nexus using curl and the default user name and password:

curl -i -v -u deployment:deployment123 --upload-file a.txt http://myserver:8081/nexus/content/repositories/releases/acp/myproject.app/1.0.0.20160622175545/a.txt

This works perfectly fine! When I go on the Nexus UI to System Feeds: Authorization and Authentication section, I can see a successful connection took place.

When I change the password to a wrong password, I can see a failed connection attempt in the Authorization and Authentication feed.

However, when I build my project using Ant I hit Unauthorized (sounds like 401). and I see absolutely nothing in the Nexus feed (this means no credentials were sent according to the Nexus documentation).

ivysettings.xml:

<ivysettings>
    <settings defaultBranch="${ivy.deliver.branch}" defaultResolver="default-chain" />
    <properties file="${ivy.settings.dir}/build.properties" />
    <credentials host="${repo.host}" realm="${repo.realm}"
    username="${repo.user}" passwd="${repo.pass}" />

    <resolvers>
        <filesystem name="local" transactional="true">
        <ivy
            pattern="${ivy.default.ivy.user.dir}/local/[organisation]/[module]/[branch]/[revision]/ivy-[revision].xml" />
            <artifact
            pattern="${ivy.default.ivy.user.dir}/local/[organisation]/[module]/[branch]/[revision]/[type]s/[artifact]-[revision].[ext]" />
        </filesystem>
        <ibiblio name="nexus" m2compatible="true" root="${nexus-public}" />
        <ibiblio name="nexus-releases" m2compatible="true" root="${nexus-releases}" />
        <chain name="default-chain">
            <resolver ref="local" />
            <resolver ref="nexus" />
        </chain>
    </resolvers>
</ivysettings>

build.properties contains (among other things):

repo.host=myserver
repo.port=8081
repo.user=deployment
repo.pass=deployment123
repo.realm=Nexus Repository Manager
bundle.publish.resolver=nexus-releases

Any ideas?

3
  • 2
    I think your realm may be incorrect. Try: "Sonatype Nexus Repository Manager". Jun 23, 2016 at 18:13
  • Thank you, Mark. That was the problem indeed! Jun 23, 2016 at 20:23
  • Can you post that as an answer so I can accept it? Jun 27, 2016 at 16:17

1 Answer 1

2

The realm was incorrect. The right value is Sonatype Nexus Repository Manager. The realm isn't necessary for using curl but it is when authenticating from Ant.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.