simpligility / maven-repository-tools

Tools for interacting with Maven repositories
Eclipse Public License 1.0
137 stars 66 forks source link

Migration of snapshot repository successfull without transfering any artifact #42

Closed papanito closed 6 years ago

papanito commented 6 years ago

I try to migrate a maven2 release and snapshot repository using v.1.3.1. The migration for the release repository works fine:

D:\TOOLS>java -jar maven-repository-provisioner-1.3.1-jar-with-dependencies.jar -cd "D:\NEXUS_WORK\storage\Releases" -t "https://nexus3/repository/releases/"
07:57:32.484 [main] INFO  MavenRepositoryProvisioner - -----------------------------------
07:57:32.487 [main] INFO  MavenRepositoryProvisioner -  Maven Repository Provisioner
07:57:32.488 [main] INFO  MavenRepositoryProvisioner -  simpligility technologies inc.
07:57:32.489 [main] INFO  MavenRepositoryProvisioner -  http://www.simpligility.com
07:57:32.489 [main] INFO  MavenRepositoryProvisioner - -----------------------------------
07:57:32.521 [main] INFO  MavenRepositoryProvisioner -
Provisioning artifacts: null
Source: https://repo1.maven.org/maven2
Target: https://nexus3/repository/Releases/
Username: null
IncludeSources: true
IncludeJavadoc: true
IncludeProvidedScope: false
IncludeTestScope: false
IncludeRuntimeScope: false
Check target: true
Verify only: false
Local cache or source repository directory: D:\NEXUS_WORK\storage\Releases

07:57:32.524 [main] INFO  MavenRepositoryProvisioner -  Absolute path: D:\NEXUS_WORK\storage\Releases
07:57:32.525 [main] INFO  MavenRepositoryProvisioner - Detected local cache directory 'D:\NEXUS_WORK\storage\Releases'.
07:57:32.525 [main] INFO  MavenRepositoryProvisioner - No artifact coordinates specified - using cache directory as source.
07:57:32.526 [main] INFO  MavenRepositoryProvisioner - Artifact retrieval skipped.
07:57:32.526 [main] INFO  MavenRepositoryProvisioner - Artifact deployment starting.
07:58:11.878 [main] INFO  LoggingTransferListener - Uploading: https://nexus3/repository/Releases/ch/axon/axon-webservice/1.0.2/axon-webservice-1.0.2-ALL.zip
....

Whereas the migration from snapshot repository just finish without transferring any artifact

D:\TOOLS>java -jar maven-repository-provisioner-1.3.1-jar-with-dependencies.jar -cd "D:\NEXUS_WORK\storage\Snapshots" -t
 "https://nexus3/repository/snapshots/"
08:01:06.140 [main] INFO  MavenRepositoryProvisioner - -----------------------------------
08:01:06.143 [main] INFO  MavenRepositoryProvisioner -  Maven Repository Provisioner
08:01:06.144 [main] INFO  MavenRepositoryProvisioner -  simpligility technologies inc.
08:01:06.145 [main] INFO  MavenRepositoryProvisioner -  http://www.simpligility.com
08:01:06.145 [main] INFO  MavenRepositoryProvisioner - -----------------------------------
08:01:06.177 [main] INFO  MavenRepositoryProvisioner -
Provisioning artifacts: null
Source: https://repo1.maven.org/maven2
Target: https://nexus3/repository/snapshots/
Username: null
IncludeSources: true
IncludeJavadoc: true
IncludeProvidedScope: false
IncludeTestScope: false
IncludeRuntimeScope: false
Check target: true
Verify only: false
Local cache or source repository directory: D:\NEXUS_WORK\storage\Snapshots

08:01:06.183 [main] INFO  MavenRepositoryProvisioner -  Absolute path: D:\NEXUS_WORK\storage\Snapshots
08:01:06.183 [main] INFO  MavenRepositoryProvisioner - Detected local cache directory 'D:\NEXUS_WORK\storage\Snapshots'.
08:01:06.184 [main] INFO  MavenRepositoryProvisioner - No artifact coordinates specified - using cache directory as source.
08:01:06.185 [main] INFO  MavenRepositoryProvisioner - Artifact retrieval skipped.
08:01:06.185 [main] INFO  MavenRepositoryProvisioner - Artifact deployment starting.
08:01:42.709 [main] INFO  MavenRepositoryProvisioner - Artifact deployment completed.
08:01:42.710 [main] INFO  MavenRepositoryProvisioner - Processing Completed.
08:01:42.710 [main] INFO  MavenRepositoryProvisioner -
Processing Summary
-----------------------------------
Configuration:

Provisioning artifacts: null
Source: https://repo1.maven.org/maven2
Target: https://nexus3/repository/snapshots/
Username: null
IncludeSources: true
IncludeJavadoc: true
IncludeProvidedScope: false
IncludeTestScope: false
IncludeRuntimeScope: false
Check target: true
Verify only: false
Local cache or source repository directory: D:\NEXUS_WORK\storage\Snapshots

Sucessful Deployments:

Failed Deployments:

Skipped Deployments (POM already in target):

Potential Deployments :

08:01:42.717 [main] INFO  MavenRepositoryProvisioner - Exiting: SUCCESS
Deployment completed successfully.

There is no error message. Any clue what the reason for this could be?

Nexus 2: 2.14.1-01 Nexus 3: 3.13.0-01

mosabua commented 6 years ago

Haha ... I never thought of this as a valid use case. So essentially the process of copying artifacts from the temporary local repo on disk into the target repo uses the maven repo format naming for files and only uploads those. It does NOT use snapshot version artifacts naming. We could change this but to be allowing snapshots but to be honest that would make things more complicated as well. Because the target repo in the target server would have to have snapshot policy as well and there is no easy way to verify that.

I am inclined to NOT work on this at all. SNAPSHOT repositories are just temporary storage for development deployments. You should never really migrate them. Just point your development to the new server and new deployments go there. Old snapshots are trash anyway so you would not want to migrate them.

Please let me know if this makes sense..

papanito commented 6 years ago

Yeah you are actually right snapshot repos should not be migrated. Don't know what came over me to this morning :smile: