src.site.apt.examples.unpacking-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.
------
Unpacking Specific Artifacts
------
Allan Ramirez
Brian Fox
------
Nov 2006
------
Unpacking Specific Artifacts
This is pretty similar to the {{{copying-artifacts.html}Copying Specific Artifacts}}
example. The difference is that instead of copying the artifacts, they are unpacked.
To unpack the copied artifacts, use the <<>> mojo and
configure the plugin into something like the sample below:
+---+
[...]
org.apache.maven.plugins
maven-dependency-plugin
unpack
package
unpack
junit
junit
3.8.1
jar
false
${project.build.directory}/alternateLocation
optional-new-name.jar
${project.build.directory}/wars
false
true
[...]
+---+
And after invoking <<>>, the artifacts are unpacked. Because checking the existence of an unpacked archive
is difficult to do reliably, marker files are used instead. The location of the marker files is controlled by the {{{unpack-dependencies-mojo.html#markersDirectory}markersDirectory}} parameter.
{Unpacking From the Command Line}:
If you intend to configure this mojo for execution on the command line using:
+---+
mvn dependency:unpack
+---+
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