Build fails when I run mvn deploy site-deploy. But works fine when I split the command. i.e., First, mvn deploy and then mvn site-deploy.
All these years we were using the command mvn deploy site-deploy to perform our builds. We recently migrated to Sonatype Nexus repository and our very first build would fail.
We are using
- Maven 2.2.1 and Sonatype Nexus 2.7.2.
- maven.site.plugin 2.1.1 and wagon-webdav-jackrabbit 2.5 in our pom file.
Any advice or input is highly appreciated. Thank you!!! :)
Our project consist of 5 child modules. It says unable to resolve artifact version 1.00.03. But, the artifact that it says missing, is the one that's currently building.
Build Logs:
/some/codebase/directory/>mvn deploy site-deploy
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] My Example Project
[INFO] Module1
[INFO] Module2
[INFO] Module3
[INFO] Module4
[INFO] Module5
[INFO] ------------------------------------------------------------------------
[INFO] Building My Example Project
[INFO] task-segment: [deploy, site-deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [install:install {execution: default-install}]
[INFO] Installing /some/codebase/directory/pom.xml to /home/.m2/repository/com/example/app/example-app/1.00.03/example-app-1.00.03.pom
[INFO] Installing /some/codebase/directory/target/example-app-1.00.03-site.xml to /home/.m2/repository/com/example/app/example-app/1.00.03/example-app-1.00.03-site.xml
[INFO] [deploy:deploy {execution: default-deploy}]
Uploading: http://localhost:8081/nexus/content/repositories/release/com/example/app/examplel-app/1.00.03/example-app-1.00.03.pom
4/14K
8/14K
12/14K
14/14K
14K uploaded (example-app-1.00.03.pom)
[INFO] Retrieving previous metadata from nexus
[INFO] Uploading repository metadata for: 'artifact com.example.app:example-app'
Uploading: http://localhost:8081/nexus/content/repositories/release/com/example/app/examplel-app/1.00.03/example-app-1.00.03-site.xml
1/1K
1K uploaded (example-app-1.00.03-site.xml)
[INFO] [site:site {execution: default-site}]
[INFO] Generating "Source Repository" report.
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin.
[INFO] Generating "Dependencies" report.
[WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink instance and no SinkFactory available. Please update this plugin.
[INFO] [site:deploy {execution: default-deploy}]
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
http://localhost:8081/nexus/content/sites/site/com.example.app/example-app - Session: Opened
Uploading: ./index.html to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
##http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./index.html - Status code: 201
Transfer finished. 4983 bytes copied in 0.028 seconds
Uploading: ./source-repository.html to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
##http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./source-repository.html - Status code: 201
Transfer finished. 5104 bytes copied in 0.024 seconds
Uploading: ./dependencies.html to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#####http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./dependencies.html - Status code: 201
Transfer finished. 20165 bytes copied in 0.024 seconds
Uploading: ./images/close.gif to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/close.gif - Status code: 201
Transfer finished. 279 bytes copied in 0.022 seconds
Uploading: ./images/external.png to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/external.png - Status code: 201
Transfer finished. 230 bytes copied in 0.024 seconds
Uploading: ./images/icon_error_sml.gif to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/icon_error_sml.gif - Status code: 201
Transfer finished. 1010 bytes copied in 0.022 seconds
Uploading: ./images/icon_info_sml.gif to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/icon_info_sml.gif - Status code: 201
Transfer finished. 606 bytes copied in 0.023 seconds
Uploading: ./images/icon_success_sml.gif to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/icon_success_sml.gif - Status code: 201
Transfer finished. 990 bytes copied in 0.023 seconds
Uploading: ./images/icon_warning_sml.gif to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/icon_warning_sml.gif - Status code: 201
Transfer finished. 576 bytes copied in 0.023 seconds
Uploading: ./images/newwindow.png to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/newwindow.png - Status code: 201
Transfer finished. 220 bytes copied in 0.023 seconds
Uploading: ./images/expanded.gif to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/expanded.gif - Status code: 201
Transfer finished. 52 bytes copied in 0.021 seconds
Uploading: ./images/collapsed.gif to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/collapsed.gif - Status code: 201
Transfer finished. 53 bytes copied in 0.022 seconds
Uploading: ./images/logos/maven-feather.png to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/logos/maven-feather.png - Status code: 201
Transfer finished. 3330 bytes copied in 0.023 seconds
Uploading: ./images/logos/build-by-maven-white.png to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/logos/build-by-maven-white.png - Status code: 201
Transfer finished. 2260 bytes copied in 0.023 seconds
Uploading: ./images/logos/build-by-maven-black.png to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./images/logos/build-by-maven-black.png - Status code: 201
Transfer finished. 2294 bytes copied in 0.023 seconds
Uploading: ./project-info.html to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
##http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./project-info.html - Status code: 201
Transfer finished. 5764 bytes copied in 0.022 seconds
Uploading: ./css/maven-theme.css to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./css/maven-theme.css - Status code: 201
Transfer finished. 3517 bytes copied in 0.025 seconds
Uploading: ./css/maven-base.css to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./css/maven-base.css - Status code: 201
Transfer finished. 2462 bytes copied in 0.023 seconds
Uploading: ./css/print.css to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./css/print.css - Status code: 201
Transfer finished. 222 bytes copied in 0.047 seconds
Uploading: ./css/site.css to http://localhost:8081/nexus/content/sites/site/com.example.app/example-app
#http://localhost:8081/nexus/content/sites/site/com.example.app/example-app/./css/site.css - Status code: 201
Transfer finished. 53 bytes copied in 0.022 seconds
http://localhost:8081/nexus/content/sites/site/com.example.app/example-app - Session: Disconnecting
http://localhost:8081/nexus/content/sites/site/com.example.app/example-app - Session: Disconnected
[INFO] ------------------------------------------------------------------------
[INFO] Building Module1
[INFO] task-segment: [deploy, site-deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [jaxb2:generate {execution: default}]
[INFO] Sources are not up-to-date; XJC execution will be executed.
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (ISO8859-1 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /some/codebase/directory/src/main/resource
[INFO] Copying 1 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 14 source files to /some/codebase/directory/app-module1/target/classes
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (ISO8859-1 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /some/codebase/directory/app-module1/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar: /some/codebase/directory/app-module1/example-app-module1-1.00.03.jar
[INFO] [install:install {execution: default-install}]
[INFO] Installing some/codebase/directory/app-module1/target/example-app-module1-1.00.03.jar to home/.m2/repository/com/example/app/example-app/1.00.03/example-app-module1-1.00.03.jar
[INFO] [deploy:deploy {execution: default-deploy}]
Uploading: http://localhost:8081/nexus/content/repositories/release/com/example/app/examplel-app/1.00.03/example-app-module1-1.00.03.jar
4/22K
8/22K
12/22K
16/22K
20/22K
22/22K
22K uploaded (example-app-module1-1.00.03.jar)
[INFO] Retrieving previous metadata from nexus
[INFO] Uploading repository metadata for: 'artifact com.example.app:example-app-module1'
[INFO] Uploading project information for example-app-module1 1.00.03
[WARNING] DEPRECATED [tags]: No reason given
[INFO] Preparing javadoc:aggregate
[INFO] ------------------------------------------------------------------------
[INFO] Building My example project
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building Module1
[INFO] ------------------------------------------------------------------------
[INFO] [jaxb2:generate {execution: default}]
[INFO] Generated sources are up-to-date; XJC execution will be skipped.
[INFO] ------------------------------------------------------------------------
[INFO] Building Module2
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building Module3
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building Module4
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building My Example Project
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building Module5
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building My Example project
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] Building Module1
[INFO] ------------------------------------------------------------------------
[INFO] [jaxb2:generate {execution: default}]
[INFO] Generated sources are up-to-date; XJC execution will be skipped.
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (ISO8859-1 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /some/codebase/directory/src/main/resource
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] Building Module2
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (ISO8859-1 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 229 source files to /some/codebase/directory/app_module2/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Building Module3
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (ISO8859-1 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO] Copying 12 resources
Downloading: http://localhost:8081/nexus/content/groups/public/com/example/app/example-app-module2/1.00.03/example-app-module2-1.00.03.jar
[INFO] Unable to find resource 'com.example.app:example-app-module2:jar:1.00.03' in repository central (http://central)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) com.example.app:example-app-module2:jar:1.00.03
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.example.app -DartifactId=example-app-module2 -Dversion=1.00.03 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.example.app -DartifactId=example-app-module2 -Dversion=1.00.03 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) com.example.app:example-app-module3:module3:1.00.03
2) com.example.app:example-app-module2:module2:1.00.03
----------
1 required artifact is missing.
for artifact:
com.example.app:example-app-module3:module3:1.00.03
from the specified remote repositories:
nexus (http://localhost:8081/nexus/content/groups/public)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18 seconds
[INFO] Finished at: Wed Apr 16 15:45:23 ADT 2014
[INFO] Final Memory: 82M/247M
[INFO] ------------------------------------------------------------------------
Parent Project's pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.app</groupId>
<artifactId>example-app</artifactId>
<version>1.00.03</version>
<name>My Example Project</name>
<packaging>pom</packaging>
<modules>
<module>app_module1</module>
<module>app_module2</module>
<module>app_module3</module>
<module>app_module4</module>
<module>app_module5</module>
</modules>
After updating the following, below is the error I'm getting.
- Maven 2.2.1 to Maven 3.2.1
- Plugin, maven.site.plugin 2.1.1 to 3.3
- Extension, wagon-webdav-jackrabbit 2.5 to 2.6
Error Message:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] My Example Project ................................ FAILURE [ 3.719 s]
[INFO] Module1 ........................................... SKIPPED
[INFO] Module2 ........................................... SKIPPED
[INFO] Module3 ........................................... SKIPPED
[INFO] Module4 ........................................... SKIPPED
[INFO] Module5 ........................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.128 s
[INFO] Finished at: 2014-04-21T06:29:27-08:00
[INFO] Final Memory: 19M/51M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:deploy (default-deploy) on project example-app: Unsupported protocol: 'dav' for site deployment to distributionManagement.site.url=dav:http://localhost:8081/repo/content/sites/site/com.example.app/example-app/. -> [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