11

Sometimes I wanted to deploy, but I typed mvn package.

Sometimes I want to deploy to another alternative repository (using mvn deploy -DaltDeploymentRepository=...), immediately after the default deploy.

So I really don't want to package and test them again, because they are just succeeded. The result jars are just there, in the target/ directory. I hope I can deploy them.

I know there is deploy:deploy-file, but that's inconvenient to use, I don't want to specify groupId, artifactId again on the command line. It doesn't work for large project which contains a lot of jars to deploy, too.

wonea
  • 1,817
  • 1
  • 23
  • 42
Lenik
  • 17,942
  • 25
  • 87
  • 119

1 Answers1

0

Use the maven.test.skip command line flag to skips tests:

mvn -Dmaven.test.skip=true install

Use the maven.repo.list command line flag to add another repository:

mvn -Dmaven.repo.list=
Paul Sweatte
  • 729
  • 5
  • 16
  • But this will only skip tests but still perform packaging, right? – Lii Feb 03 '17 at 10:45
  • This will run the whole pipeline again, skipping tests. Some of the plugins may rely on previous build-results, many won't. Most of the standard-plugins will obey the flag and won't run again, but many other plugins will ignore it and thus will run again. Also, some of the maven plugins, which are skipped due to this flag, should actually run (partially) none-the-less, but won't. For instance, the test-jar goal is skipped when tests are skipped, and thus the test-jar is not attached to the list of release-artifacts and is thus not deployed by "mvn deploy -Dmaven.test.skip=true". – Robin479 May 13 '19 at 09:02