You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by di...@apache.org on 2004/07/12 08:58:01 UTC

cvs commit: maven-plugins/jar/xdocs properties.xml changes.xml

dion        2004/07/11 23:58:01

  Modified:    jar      project.xml plugin.jelly plugin.properties
               jar/xdocs properties.xml changes.xml
  Added:       jar/src/plugin-test project.xml .cvsignore maven.xml
               jar/src/plugin-test/src/main/org/apache/maven Dummy.java
  Log:
  MPJAR-32. Allow jars to include source code.
  
  Revision  Changes    Path
  1.30      +1 -1      maven-plugins/jar/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/jar/project.xml,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- project.xml	28 Jun 2004 11:26:31 -0000	1.29
  +++ project.xml	12 Jul 2004 06:58:00 -0000	1.30
  @@ -23,7 +23,7 @@
     <pomVersion>3</pomVersion>
     <id>maven-jar-plugin</id>
     <name>Maven Jar Plug-in</name>
  -  <currentVersion>1.6</currentVersion>
  +  <currentVersion>1.6.1-SNAPSHOT</currentVersion>
     <description>Plugin for creating JAR files. Requires Maven 1.0 RC2.</description>
     <shortDescription>Create jar files</shortDescription>
     <url>http://maven.apache.org/reference/plugins/jar/</url>
  
  
  
  1.41      +18 -1     maven-plugins/jar/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/jar/plugin.jelly,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- plugin.jelly	28 Jun 2004 09:51:29 -0000	1.40
  +++ plugin.jelly	12 Jul 2004 06:58:00 -0000	1.41
  @@ -63,7 +63,11 @@
           <ant:fail>You must define currentVersion in your POM.</ant:fail>
         </j:when>
       </j:choose>
  -    
  +
  +    <j:if test="${maven.jar.include.source}">
  +      <attainGoal name="jar:copy-source"/>
  +    </j:if>
  +        
       <ant:available property="maven.jar.manifest.available" 
         file="${maven.jar.manifest}"/>
   
  @@ -269,4 +273,17 @@
         project="${pom}"
       />
     </goal>
  +  
  +  <!-- ================================================================== -->
  +  <!-- C O P Y   S O U R C E                                              -->
  +  <!-- ================================================================== -->
  +  <goal name="jar:copy-source" description="Copy source code for inclusion in the jar">
  +    <util:available file="${pom.build.sourceDirectory}">
  +      <ant:mkdir dir="${maven.build.dest}/${maven.jar.source.path}"/>
  +      <ant:copy todir="${maven.build.dest}/${maven.jar.source.path}">
  +        <ant:fileset dir="${pom.build.sourceDirectory}"/>
  +      </ant:copy>
  +    </util:available>
  +  </goal>
  +  
   </project>
  
  
  
  1.11      +2 -0      maven-plugins/jar/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  RCS file: /home/cvs/maven-plugins/jar/plugin.properties,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- plugin.properties	21 Apr 2004 01:03:25 -0000	1.10
  +++ plugin.properties	12 Jul 2004 06:58:01 -0000	1.11
  @@ -24,3 +24,5 @@
   maven.jar.excludes = **/package.html
   maven.jar.index=false
   maven.jar.compress=true
  +maven.jar.include.source=false
  +maven.jar.source.path=src
  \ No newline at end of file
  
  
  
  1.1                  maven-plugins/jar/src/plugin-test/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- 
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed 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.
   */
   -->
  
  
  <project>
    <pomVersion>3</pomVersion>
    <id>test-maven-jar-plugin</id>
    <name>Test project for Maven Jar Plugin</name>
    <groupId>maven</groupId>
    <currentVersion>1.0-SNAPSHOT</currentVersion>
    <organization>
      <name>Apache Software Foundation</name>
      <url>http://www.apache.org/</url>
      <logo>http://maven.apache.org/images/jakarta-logo-blue.gif</logo>
    </organization>
    <inceptionYear>2001</inceptionYear>
    <package>org.apache.maven</package>
    <logo>http://maven.apache.org/images/maven.jpg</logo>
    <description>Test for Maven Jar plugin</description>
    <shortDescription>Test for Maven Jar plugin</shortDescription>
    <url>http://maven.apache.org/reference/plugins/jar/</url>
    <siteDirectory>/www/maven.apache.org/reference/plugins/jar/</siteDirectory>
    <repository>
      <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven/src/plugins-build/jar/</connection>
      <url>http://cvs.apache.org/viewcvs/maven/src/plugins-build/jar/</url>
    </repository>
    <developers>
      <developer>
        <name>dIon Gillard</name>
        <id>dion</id>
        <email>dion@multitask.com.au</email>
        <organization>Multitask Consulting</organization>
        <roles>
          <role>Documentation</role>
        </roles>
      </developer>
    </developers>
  
    <build>
      <sourceDirectory>src/main</sourceDirectory>
    </build>
  </project>
  
  
  
  1.1                  maven-plugins/jar/src/plugin-test/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  gump.xml
  *.log
  
  
  
  1.1                  maven-plugins/jar/src/plugin-test/maven.xml
  
  Index: maven.xml
  ===================================================================
  <!-- 
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed 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.
   */
   -->
  <project xmlns:util="jelly:util"
           xmlns:assert="assert"
           xmlns:j="jelly:core">
           
    <goal name="testPlugin" prereqs="test-jar">
      <attainGoal name="clean"/>
    </goal>
    
    <goal name="test-jar" 
      prereqs="test-jar-created,test-jar-with-source,test-jar-without-source,test-jar-with-custom-source">
      <j:set var="finalJar" value="${maven.build.dir}/${maven.final.name}.jar"/>
    </goal>
    
    <goal name="test-jar-created">
      <attainGoal name="clean"/>
      <attainGoal name="jar"/>
      <j:set var="finalJar" value="${maven.build.dir}/${maven.final.name}.jar"/>
      <assert:assertFileExists file="${finalJar}"/>
    </goal>
  
    <goal name="test-jar-with-source">
      <j:set var="maven.jar.include.source" value="true"/>
      <attainGoal name="test-jar-created"/>
      <!-- unzip the jar and check for the source -->
      <unzip src="${finalJar}" dest="${maven.build.dir}/jar-test"/>
      <assert:assertFileExists file="${maven.build.dir}/jar-test/src/org/apache/maven/Dummy.java"/>
    </goal>
  
    <goal name="test-jar-without-source">
      <j:set var="maven.jar.include.source" value="false"/>
      <attainGoal name="test-jar-created"/>
      <!-- unzip the jar and check for the source -->
      <unzip src="${finalJar}" dest="${maven.build.dir}/jar-test"/>
      <assert:assertFileNotFound file="${maven.build.dir}/jar-test/src/org/apache/maven/Dummy.java"/>
    </goal>
  
    <goal name="test-jar-with-custom-source">
      <j:set var="maven.jar.include.source" value="true"/>
      <j:set var="maven.jar.source.path" value="sourceDir"/>
      <attainGoal name="test-jar-created"/>
      <!-- unzip the jar and check for the source -->
      <unzip src="${finalJar}" dest="${maven.build.dir}/jar-test"/>
      <assert:assertFileExists file="${maven.build.dir}/jar-test/sourceDir/org/apache/maven/Dummy.java"/>
    </goal>
    
  </project>
  
  
  1.1                  maven-plugins/jar/src/plugin-test/src/main/org/apache/maven/Dummy.java
  
  Index: Dummy.java
  ===================================================================
  package org.apache.maven;
  
  public class Dummy
  {
      public String badChecky = "error";
  } 
  
  
  1.10      +21 -5     maven-plugins/jar/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/jar/xdocs/properties.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- properties.xml	4 Mar 2004 18:35:27 -0000	1.9
  +++ properties.xml	12 Jul 2004 06:58:01 -0000	1.10
  @@ -63,6 +63,14 @@
             </td>
           </tr>
           <tr>
  +          <td>maven.jar.include.source</td>
  +          <td>Yes</td>
  +          <td>
  +            Whether the source should be included in the jar.
  +            The default value is <code>false</code>
  +          </td>
  +        </tr>
  +        <tr>
             <td>maven.jar.index</td>
             <td>Yes</td>
             <td>
  @@ -131,11 +139,19 @@
               project descriptor</a>
             </td>
           </tr>
  -	<tr>
  -		<td>maven.jar.compress</td>
  -		<td>Yes</td>
  -		<td>Not only store data but also compress them, defaults to true.</td>
  -	</tr>
  +        <tr>
  +		  <td>maven.jar.compress</td>
  +		  <td>Yes</td>
  +		  <td>Not only store data but also compress them, defaults to true.</td>
  +        </tr>
  +        <tr>
  +          <td>maven.jar.source.path</td>
  +          <td>Yes</td>
  +          <td>
  +            The location of the source code within the jar, if included.
  +            The default value is <code>src</code>
  +          </td>
  +        </tr>
         </table>
       </section>
       <section name="Deploy Settings">
  
  
  
  1.22      +3 -0      maven-plugins/jar/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/jar/xdocs/changes.xml,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- changes.xml	28 Jun 2004 11:26:31 -0000	1.21
  +++ changes.xml	12 Jul 2004 06:58:01 -0000	1.22
  @@ -25,6 +25,9 @@
       <author email="dion@apache.org">dIon Gillard</author>
     </properties>
     <body>
  +    <release version="1.6.1" date="in CVS">
  +      <action dev="dion" type="add">Add the ability to create source jars</action>
  +    </release>
       <release version="1.6" date="2004-06-28">
         <action dev="brett" type="update">Use the artifact plugin for installation</action>
         <action dev="evenisse" type="fix" due-to="Martin van den Bemt" issue="MPJAR-29">Replace Apache Jakarta Maven by Apache Maven in Manifest</action>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org