Deploy an artifact in legacy layout

"Legacy" is the layout used in maven 1 repositories while maven 2 uses "default". They are different in terms of directory structure, timestamp of snapshots in default and existence of metadata files in default.

  • legacy layout directory structure:
  • default layout directory structure:
         |  `---artifact

    In able to deploy an artifact in a legacy layout of repository, set the repositoryLayout parameter to legacy value.

    mvn org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy-file -Durl=file:///C:/m2-repo \
                                                                                -Dfile=your-artifact-1.0.jar \
                                                                                -DpomFile=your-pom.xml \

    Note: By using the fully qualified path of a goal, you're ensured to be using the preferred version of the maven-deploy-plugin. When using mvn deploy:deploy-file its version depends on its specification in the pom or the version of Apache Maven.