2

I'm unable to deploy the site made by the maven-site-plugin.

I get similar errors as in this question: Maven site deploy logs filling with [WARNING] Required credentials to nexus 3 but there is an comment in it which says that the issue is known and reported here https://issues.sonatype.org/browse/NEXUS-10112 but this issue is closed.

I followed the tutorial http://books.sonatype.com/nexus-book/reference/_creating_a_new_maven_project.html everything is fine till the step 20.6 the site:deploy.

The only "solution" I found to this problem is here https://benkiew.wordpress.com/2009/11/27/status-code-401-on-mvn-sitedeploy/ but it doesn't work. My settings.xml and pom.xml match, so it is not the issue.

The settings.xml server conf looks as follows:

   </servers>
    <server>        
      <id>nexus</id>        
      <username>XXXX</username>
      <password>XXXX</password>
    </server>
   </servers>

And the parent pom.xml:

      <site>
          <id>nexus</id>
          <name>service-agents-repository</name>
          <url>dav:https://!URL!/repo/content/sites/agents</url>
      </site>

The id of provided by nexus is different as the two shown above, but I tried also with that ID, and I'm writing this question so didn't work. Error output by mvn site:deploy

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Services: IoT agents
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Services: IoT agents 1.3.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-site-plugin:3.5.1:deploy (default-cli) @ parent ---
https://!URL!/repo/content/sites/agents/ - Session: Opened
[INFO] Pushing D:\!URL!\target\site
[INFO]    >>> to https://!URL!/repo/content/sites/agents/./
[WARNING] Required credentials not available for BASIC <any realm>@!URL!:443
[WARNING] Preemptive authentication requested but no default credentials available
[INFO] basic authentication scheme selected
[INFO] Failure authenticating with BASIC 'Sonatype Nexus Repository Manager'@!URL!:443
[WARNING] Required credentials not available for BASIC <any realm>@!URL!:443
[WARNING] Preemptive authentication requested but no default credentials available
[INFO] basic authentication scheme selected
[INFO] Failure authenticating with BASIC 'Sonatype Nexus Repository Manager'@!URL!:443
[WARNING] Required credentials not available for BASIC <any realm>@!URL!:443
[WARNING] Preemptive authentication requested but no default credentials available
[WARNING] Required credentials not available for BASIC <any realm>@!URL!:443
[WARNING] Preemptive authentication requested but no default credentials available
[INFO] basic authentication scheme selected
[INFO] Failure authenticating with BASIC 'Sonatype Nexus Repository Manager'@!URL!:443
 Transfer error: java.io.IOException: Unable to create collection: https://!URL!/repo/content/sites/agents/; status code = 401
Uploading: .//apidocs/allclasses-frame.html to https://!URL!/repo/content/sites/agents/

[WARNING] Required credentials not available for BASIC <any realm>@linksmart.eu:443
[WARNING] Preemptive authentication requested but no default credentials available
#########[INFO] basic authentication scheme selected
[INFO] Failure authenticating with BASIC 'Sonatype Nexus Repository Manager'@!URL!:443
https://!URL!/repo/content/sites/agents/./apidocs/allclasses-frame.html - Status code: 401
 Transfer error: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: https://!URL!/repo/content/sites/agents/./apidocs/allclasses-frame.html. Return code is: 401
https://!URL!/repo/content/sites/agents/ - Session: Disconnecting
https://!URL!/repo/content/sites/agents/ - Session: Disconnected
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Services: IoT agents ........................... FAILURE [  2.352 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.661 s
[INFO] Finished at: 2016-09-29T17:04:57+01:00
[INFO] Final Memory: 19M/219M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.5.1:deploy (default-cli) on project parent: Error uploading site: Failed to transfer file: https://!URL!/repo/content/sites/agents/./apidocs/allclasses-frame.html. Return code is: 401 -> [
Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

If more info needed please just ask.

Thanks.

Community
  • 1
  • 1
ender.an27
  • 703
  • 1
  • 13
  • 35

2 Answers2

0

It seems you've followed the documentation for Nexus Repository Manager 2. You might try the docs for Nexus 3 specifically: http://books.sonatype.com/nexus-book/3.0/reference/raw.html#_configuring_maven_for_site_deployment

If that doesn't help, let me know what version of Nexus 3 you are running, we made some changes to the realm name in 3.0.2 versus 3.0.0, although I don't think that is the issue.

DarthHater
  • 3,222
  • 25
  • 26
  • Thanks. I'm using nexus 2. My problem I think is about SSL/TLS part. Somehow I'm not able to match my user with website `credentials not available for BASIC @!URL!:` – ender.an27 Sep 30 '16 at 06:56
0

Sorry about the question.

There was error. The problem was that Maven was pointing to wrong settings.xml file and was not getting the credentials. Therefore the configuration shown here is fine.

Thanks.

ender.an27
  • 703
  • 1
  • 13
  • 35