Generates a list of mvn commands that can be executed to upload artifacts from a directory to a remote repository. To use the generated commands, you need to configure your Maven settings.xml with the target repository (id, user, password).
This script is intended for users who'd like to migrate their Sonatype Nexus installation to the new 3.0 version. Since there is no migration assistant for upgrades from 2.x to 3.0 (expected with version 3.1), it is required to manually upload all artifacts again.
Nexus 2.x saved the artifacts in the sonatype-work directory on the filesystem. Therefore one can copy all their artifacts from the specific repository directories into one directory, and then execute this program. Make sure that you do not copy .index or .meta directories from the sonatype-work directory, since those will cause SAXParserExceptions.
Once the program finishes running, you will receive an output file that contains mvn deploy commands for each and every artifact that was found, which you then can just run as script.
Example repository configuration:
<settings>
...
<servers>
<server>
<id>repository-id</id>
<username>deployment-user</username>
<password>password</password>
</server>
</servers>
</settings>
The value of the <id>
tag needs to be passed as the -r
parameter to the application.
The following options are required: -o -r -d -u
Usage: <main class> [options]
Options:
* -d
The directory to scan for pom files
* -o
The shell script that should be generated by this application
* -r
The target repository id that is configured in the settings.xml
* -u
The target deployment URL for releases
* -s
The target deployment URL for snapshots
* -w
Windows batch mode - adds a call command before each mvn command to allow execution within a batch script, otherwise a shell script will be created