Reputation: 300
I have a very large number of project that I'm migrating to maven... but i have several restrictions.
One of those is to leave the results of the builds in a certain folder.
I'm trying to make maven install the project artifacts to the local repository (.m2 as usual, because the have dependencies from one to another) and also put the jars/wars/ears files into the custom folder I refered before.
I've already used this:
<project>
...
<build>
<directory>${basedir}/../../target/</directory>
<plugins>
</plugins>
</build>
</project>
The proyect consist in several .ear and .jar, we used to run many ant's to get those files generated in certain folder.
I'm trying to put those files in that folder from maven, so I have the exact same code i show here in every pom, but when i run maven, all but the last one is deposited in the folder (because every pom cleans that folder i supose)
Upvotes: 1
Views: 5008
Reputation: 6227
If you want only copy packages to other path, you can use maven-antrun-plugin
to do this.
You can configure the plugin something like this:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>config</id>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy todir="${the.custom.folder}" overwrite="true">
<fileset dir="${project.build.directory}" includes="**/*.jar **/*.ear" />
</copy>
</target>
</configuration>
</execution>
</executions>
</plugin>
Also look at some artifact repository, such as Artifactory or Nexus.
Upvotes: 1