Socrates
Socrates

Reputation: 9604

Change default Maven path?

Is it possible to change the default path where Maven places a *.war or a *.jar after the install process? Can I alter this to a personalized path? If yes, how would I do that? All my projects currently follow the following paths:

--- maven-install-plugin:2.3.1:install (default-install) @ myProject ---
Installing /home/myuser/NetBeansProjects/myProject/target/myProject-1.0.war to /home/myuser/.m2/repository/com/allproj/myProject/1.0/myProject-1.0.war

Upvotes: 0

Views: 298

Answers (2)

Steve C
Steve C

Reputation: 19445

In general it's not a good idea to mess with the maven-install-plugin for the purpose of delivering artifacts to a specific destination. The purpose of the install plugin is to store not only the artifact but a bunch of associated metadata into a local artifact repository.

You can use the WildFly Maven Plugin if you want to install your WAR file into a WildFly instance.

Alternatively you can use the copy goal of the Maven Dependency Plugin to place a copy of your WAR file (or any other artifact) wherever you need.

Upvotes: 1

dReAmEr
dReAmEr

Reputation: 7196

Yes you can customize it.

Just uncomment below lines in settings.xml file inside conf folder of maven installation directory.

<!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->

You can uncomment it and add path in localRepository tag for your new location,then maven will start downloading all the artifact and install your app in the new location.

Upvotes: 2

Related Questions