Skip to content
Commits on Source (8)
target/
.project
.classpath
.settings/
.svn/
bin/
# Intellij
*.ipr
*.iml
.idea
out/
.DS_Store
/bootstrap
/dependencies.xml
.java-version
/**
* 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.
*/
asfMavenTlpStdBuild()
maven-jar-plugin (3.1.0-1) unstable; urgency=medium
* Team upload.
* New upstream release
- Relocate the previous version of the plugin (3.0.2) to the new one
* Standards-Version updated to 4.1.5
* Switch to debhelper level 11
* Use salsa.debian.org Vcs-* URLs
* Track and download the new releases from GitHub
-- Emmanuel Bourg <ebourg@apache.org> Mon, 30 Jul 2018 09:48:26 +0200
maven-jar-plugin (3.0.2-2) unstable; urgency=medium
* Team upload.
......
......@@ -4,7 +4,7 @@ Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Uploaders: Torsten Werner <twerner@debian.org>
Build-Depends:
debhelper (>= 10),
debhelper (>= 11~),
default-jdk,
junit4,
libcommons-lang-java,
......@@ -18,9 +18,9 @@ Build-Depends:
libplexus-io-java,
libplexus-utils-java,
maven-debian-helper (>= 2.2)
Standards-Version: 4.0.0
Vcs-Git: https://anonscm.debian.org/git/pkg-java/maven-jar-plugin.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/maven-jar-plugin.git
Standards-Version: 4.1.5
Vcs-Git: https://salsa.debian.org/java-team/maven-jar-plugin.git
Vcs-Browser: https://salsa.debian.org/java-team/maven-jar-plugin
Homepage: http://maven.apache.org/plugins/maven-jar-plugin/
Package: libmaven-jar-plugin-java
......
......@@ -25,4 +25,4 @@
# --site-xml=<location>: Optional, the location for site.xml if it needs to be installed.
# Empty by default. [mh_install]
#
pom.xml --no-parent --has-package-version --relocate=org.apache.maven.plugins:maven-jar-plugin:2.4
pom.xml --no-parent --has-package-version --relocate=org.apache.maven.plugins:maven-jar-plugin:2.4,org.apache.maven.plugins:maven-jar-plugin:3.0.2
#!/bin/sh -e
VERSION=$2
TAR=../maven-jar-plugin_$VERSION.orig.tar.xz
DIR=maven-jar-plugin-$VERSION
TAG=$(echo "maven-jar-plugin-$VERSION" | sed -re's/~(alpha|beta)/-\1-/')
svn export http://svn.apache.org/repos/asf/maven/plugins/tags/${TAG}/ $DIR
XZ_OPT=--best tar -c -J -f $TAR --exclude '*.jar' --exclude '*.class' $DIR
rm -rf $DIR ../$TAG
......@@ -2,6 +2,3 @@
%:
dh $@
get-orig-source:
uscan --download-current-version --force-download --rename
version=3
opts="uversionmangle=s/-(alpha|beta)-/~$1/" \
http://svn.apache.org/repos/asf/maven/plugins/tags/ \
maven-jar-plugin-(\d.*)/ debian debian/orig-tar.sh
version=4
opts="repack,compression=xz,uversionmangle=s/-(alpha|beta)-/~$1/" \
https://github.com/apache/maven-jar-plugin/tags .*/maven-jar-plugin-([\d\.]+).tar.gz
<?xml version='1.0' encoding='UTF-8'?>
<!--
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
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.
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
......@@ -25,12 +25,12 @@ under the License.
<parent>
<artifactId>maven-plugins</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>30</version>
<version>31</version>
<relativePath>../../pom/maven/maven-plugins/pom.xml</relativePath>
</parent>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<version>3.1.0</version>
<packaging>maven-plugin</packaging>
<name>Apache Maven JAR Plugin</name>
......@@ -54,14 +54,19 @@ under the License.
</prerequisites>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-jar-plugin-3.0.2</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-jar-plugin-3.0.2</developerConnection>
<url>http://svn.apache.org/viewvc/maven/plugins/tags/maven-jar-plugin-3.0.2</url>
<connection>scm:git:https://gitbox.apache.org/repos/asf/maven-jar-plugin.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-jar-plugin.git</developerConnection>
<url>https://github.com/apache/maven-jar-plugin/tree/${project.scm.tag}</url>
<tag>maven-jar-plugin-3.1.0</tag>
</scm>
<issueManagement>
<system>JIRA</system>
<url>https://issues.apache.org/jira/browse/MJAR</url>
</issueManagement>
<ciManagement>
<system>Jenkins</system>
<url>https://builds.apache.org/job/maven-box/job/maven-jar-plugin/</url>
</ciManagement>
<distributionManagement>
<site>
<id>apache.website</id>
......@@ -70,8 +75,10 @@ under the License.
</distributionManagement>
<properties>
<mavenArchiverVersion>3.1.1</mavenArchiverVersion>
<mavenArchiverVersion>3.2.0</mavenArchiverVersion>
<mavenVersion>3.0</mavenVersion>
<javaVersion>7</javaVersion>
<surefire.version>2.21.0</surefire.version>
</properties>
<dependencies>
......@@ -101,15 +108,20 @@ under the License.
<artifactId>maven-plugin-annotations</artifactId>
<scope>provided</scope>
</dependency>
<!--
! other dependencies contain references to older versions
! so we define it here explicit to make sure we get the
! correct version for plexus-archiver and plexus-utils.
-->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>3.4</version>
<version>3.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.24</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
......
......@@ -67,13 +67,13 @@
<!-- START SNIPPET: jar-lifecycle -->
<phases>
<process-resources>
org.apache.maven.plugins:maven-resources-plugin:2.7:resources
org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources
</process-resources>
<compile>
org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile
</compile>
<process-test-resources>
org.apache.maven.plugins:maven-resources-plugin:2.7:testResources
org.apache.maven.plugins:maven-resources-plugin:3.0.2:testResources
</process-test-resources>
<test-compile>
org.apache.maven.plugins:maven-compiler-plugin:3.5.1:testCompile
......
......@@ -37,7 +37,7 @@ import java.io.File;
* Base class for creating a jar from project classes.
*
* @author <a href="evenisse@apache.org">Emmanuel Venisse</a>
* @version $Id: AbstractJarMojo.java 1740869 2016-04-25 18:08:04Z khmarbaise $
* @version $Id$
*/
public abstract class AbstractJarMojo
extends AbstractMojo
......
......@@ -30,7 +30,7 @@ import java.io.File;
* Build a JAR from the current project.
*
* @author <a href="evenisse@apache.org">Emmanuel Venisse</a>
* @version $Id: JarMojo.java 1740869 2016-04-25 18:08:04Z khmarbaise $
* @version $Id$
*/
@Mojo( name = "jar", defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true, threadSafe = true,
requiresDependencyResolution = ResolutionScope.RUNTIME )
......
......@@ -30,7 +30,7 @@ import org.apache.maven.plugins.annotations.ResolutionScope;
* Build a JAR of the test classes for the current project.
*
* @author <a href="evenisse@apache.org">Emmanuel Venisse</a>
* @version $Id: TestJarMojo.java 1740869 2016-04-25 18:08:04Z khmarbaise $
* @version $Id$
*/
// CHECKSTYLE_OFF: LineLength
@Mojo( name = "test-jar", defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true, threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST )
......
......@@ -28,15 +28,15 @@
How to create a jar containing test classes
When you want to create a jar containing test-classes, you would probably want to reuse those classes.
When you want to create a jar containing <test-classes>, you would probably want to reuse those classes.
There are two ways to solve this:
* Create an attached jar with the test-classes from the current project and loose its transitive <<<test>>>-scoped dependencies.
* Create an attached jar with the <test-classes> from the current project and loose its transitive <<<test>>>-scoped dependencies.
* Create a separate project with the test-classes.
* Create a separate project with the <test-classes>.
[]
* The easy way
You can produce a jar which will include your test classes and resources.
......@@ -75,6 +75,7 @@ How to create a jar containing test classes
<dependency>
<groupId>groupId</groupId>
<artifactId>artifactId</artifactId>
<classifier>tests</classifier>
<type>test-jar</type>
<version>version</version>
<scope>test</scope>
......@@ -84,9 +85,18 @@ How to create a jar containing test classes
</project>
+-----------------+
Based on such configuration there will be two jar files generated. The first one contains the
classes from <<<src/main/java>>> whereas the second one will contain the classes from <<<src/test/java>>>.
The generated jar files follow the naming schema <<<artifactId-version.jar>>> for the first one and
<<<artifactId-version-classifier.jar>>> for the second one. The parts <<<artifactId>>>, <<<versions>>>
will be replaced by the values given within your project <<<pom.xml>>> file. The <<<classifier>>>
will be set to <<<tests>>> which is a default of the maven-jar-plugin which can be changed if you need by
using the configuration in the jar goal
{{{../test-jar-mojo.html}using the configuration in the jar goal}}.
<<Note:>> The downside of this solution is that you don't get the transitive <<<test>>>-scoped dependencies automatically.
Maven only resolves the <<<compile>>>-time dependencies, so you'll have to add all the other required <<<test>>>-scoped dependencies by hand.
* The preferred way
In order to let Maven resolve all <<<test>>>-scoped transitive dependencies you should create a separate project.
......@@ -100,14 +110,17 @@ How to create a jar containing test classes
</project>
+-----------------+
* Move the sources files from <<<src/test/java>>> you want to share from the original project to the <<<src/main/java>>> of this project.
* Move the sources files from <<<src/test/java>>> you want to share from
the original project to the <<<src/main/java>>> of this project.
The same type of movement counts for the resources as well of course.
* Move the required <<<test>>>-scoped dependencies and from the original project to this project and remove the scope (i.e. changing it to the <<<compile>>>-scope).
And yes, that means that the junit dependency (or any other testing framework dependency) gets the default scope too.
You'll probably need to add some project specific dependencies as well to let it all compile again.
* Move the required <<<test>>>-scoped dependencies and from the original
project to this project and remove the scope (i.e. changing it to the <<<compile>>>-scope).
And yes, that means that the junit dependency (or any other testing
framework dependency) gets the default scope too. You'll probably need
to add some project specific dependencies as well to let it all compile again.
Now you have your reusable test-classes and you can refer to it as you're used to:
Now you have your reusable <test-classes> and you can refer to it as you're used to:
+-----------------+
<project>
......
......@@ -75,9 +75,7 @@ ${project.name}
* Usage
General instructions on how to use the JAR Plugin can be found on the {{{./usage.html}usage page}}. Some more
specific use cases are described in the examples given below. Last but not least, users occasionally contribute
additional examples, tips or errata to the
{{{http://docs.codehaus.org/display/MAVENUSER/JAR+Plugin}plugin's wiki page}}.
specific use cases are described in the examples given below.
In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel
free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could
......
......@@ -33,9 +33,9 @@ under the License.
<item name="Download" href="download.html"/>
</menu>
<menu name="Examples">
<item name="Creating an Executable JAR File" href="/shared/maven-archiver/examples/classpath.html"/>
<item name="Creating an Executable JAR File" href="../../shared/maven-archiver/examples/classpath.html"/>
<item name="Manifest Customization" href="examples/manifest-customization.html"/>
<item name="Using Your Own Manifest File" href="/shared/maven-archiver/examples/manifestFile.html"/>
<item name="Using Your Own Manifest File" href="../../shared/maven-archiver/examples/manifestFile.html"/>
<item name="Additional attached JAR" href="examples/attached-jar.html"/>
<item name="Create Test JAR" href="examples/create-test-jar.html"/>
<item name="Include/Exclude content" href="examples/include-exclude.html"/>
......
......@@ -27,7 +27,7 @@ import org.apache.maven.plugins.jar.JarMojo;
/**
* Test for {@link JarMojo}
*
* @version $Id: JarMojoTest.java 1720830 2015-12-18 17:40:21Z khmarbaise $
* @version $Id$
*/
public class JarMojoTest
extends AbstractMojoTestCase
......@@ -46,7 +46,7 @@ public class JarMojoTest
/**
* tests the proper discovery and configuration of the mojo
*
* @throws Exception
* @throws Exception in case of an error.
*/
public void testJarTestEnvironment()
throws Exception
......