You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2018/03/30 17:54:37 UTC

[maven-jar-plugin] branch MJAR-245 updated (83fa32d -> 3ec43fd)

This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a change to branch MJAR-245
in repository https://gitbox.apache.org/repos/asf/maven-jar-plugin.git.


 discard 83fa32d  [MJAR-245] - Additional attached jar: role of classifyer  o Added explanations about test jar  o Added missing classifier in example.
     add 39fc58f  [MJAR-249] - Get Build working on JDK 10  o Need to upgrade maven-surefire/failsafe plugin to 2.21.0    to get it working in JDK 10.
     new 3ec43fd  [MJAR-245] - Additional attached jar: role of classifyer  o Added explanations about test jar  o Added missing classifier in example.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (83fa32d)
            \
             N -- N -- N   refs/heads/MJAR-245 (3ec43fd)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 1 +
 1 file changed, 1 insertion(+)

-- 
To stop receiving notification emails like this one, please contact
khmarbaise@apache.org.

[maven-jar-plugin] 01/01: [MJAR-245] - Additional attached jar: role of classifyer o Added explanations about test jar o Added missing classifier in example.

Posted by kh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch MJAR-245
in repository https://gitbox.apache.org/repos/asf/maven-jar-plugin.git

commit 3ec43fddd0aceb62b985fb9ff59bbeb6efd6d312
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed Mar 28 20:20:59 2018 +0200

    [MJAR-245] - Additional attached jar: role of classifyer
     o Added explanations about test jar
     o Added missing classifier in example.
---
 src/site/apt/examples/create-test-jar.apt.vm | 33 +++++++++++++++++++---------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/src/site/apt/examples/create-test-jar.apt.vm b/src/site/apt/examples/create-test-jar.apt.vm
index 27b3f0d..5b7d962 100644
--- a/src/site/apt/examples/create-test-jar.apt.vm
+++ b/src/site/apt/examples/create-test-jar.apt.vm
@@ -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>

-- 
To stop receiving notification emails like this one, please contact
khmarbaise@apache.org.