src.site.apt.examples.copying-artifacts.apt Maven / Gradle / Ivy
~~ Licensed to the Apache Software Foundation (ASF) under one
~~ or more contributor license agreements. See the NOTICE file
~~ distributed with this work for additional information
~~ regarding copyright ownership. The ASF licenses this file
~~ to you under the Apache License, Version 2.0 (the
~~ "License"); you may not use this file except in compliance
~~ with the License. You may obtain a copy of the License at
~~
~~ http://www.apache.org/licenses/LICENSE-2.0
~~
~~ Unless required by applicable law or agreed to in writing,
~~ software distributed under the License is distributed on an
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~~ KIND, either express or implied. See the License for the
~~ specific language governing permissions and limitations
~~ under the License.
------
Copying Specific Artifacts
------
Allan Ramirez
Brian Fox
------
Mar 2007
------
Copying Specific Artifacts
In copying specific artifacts, you need to bind the <<>>
mojo to a lifecycle, configure the plugin and specify the artifacts you
want to copy. See the following example:
+---+
[...]
org.apache.maven.plugins
maven-dependency-plugin
copy
package
copy
junit
junit
3.8.1
jar
false
${project.build.directory}/alternateLocation
optional-new-name.jar
${project.build.directory}/wars
false
true
[...]
+---+
Then after executing <<>> the artifact (junit) is copied to the
given alternateLocation.
The <<>> goal can also be used to copy the just built
artifact to a custom location if desired. It must be bound after the
install phase so that the artifact exists in the repository. The following
configuration shows how:
+---+
[...]
org.apache.maven.plugins
dependency-maven-plugin
copy-installed
install
copy
${project.groupId}
${project.artifactId}
${project.version}
${project.packaging}
some-other-place
[...]
+---+
{Copying From the Command Line}:
If you intend to configure this mojo for execution on the command line using:
+---+
mvn dependency:copy
+---+
you must not put the configuration inside the tag. Your configuration should look like this:
+---+
[...]
org.apache.maven.plugins
maven-dependency-plugin
[ groupId ]
[ artifactId ]
[ version ]
[ packaging ]
[ true or false ]
[ output directory ]
[ filename ]
[...]
+---+
© 2015 - 2024 Weber Informatics LLC | Privacy Policy