You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by da...@apache.org on 2006/11/23 19:18:58 UTC

svn commit: r478629 - in /webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src: main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java site/apt/configuration.apt

Author: davidillsley
Date: Thu Nov 23 10:18:55 2006
New Revision: 478629

URL: http://svn.apache.org/viewvc?view=rev&rev=478629
Log:
Add configuration option to the axis2-mar-maven-plugin to
allow mars to be built and not contain all the project
dependencies.

Modified:
    webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java
    webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src/site/apt/configuration.apt

Modified: webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java?view=diff&rev=478629&r1=478628&r2=478629
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java Thu Nov 23 10:18:55 2006
@@ -91,6 +91,13 @@
     private FileSet[] fileSets;
 
     /**
+     * Whether the dependency jars should be included in the mar
+     * 
+     * @parameter expression="${includeDependencies}" default-value="true"
+     */
+    private boolean includeDependencies;
+    
+    /**
      * Builds the exploded mar file.
      * @throws MojoExecutionException
      */
@@ -125,34 +132,36 @@
             
             copyMetaInfFile( moduleXmlFile, moduleFileTarget, existsBeforeCopyingClasses, "module.xml file" );
 
-            Set artifacts = project.getArtifacts();
-
-            List duplicates = findDuplicates( artifacts );
-
-            for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
-            {
-            	Artifact artifact = (Artifact) iter.next();
-            	String targetFileName = getDefaultFinalName( artifact );
-
-            	getLog().debug( "Processing: " + targetFileName );
-
-            	if ( duplicates.contains( targetFileName ) )
-            	{
-            		getLog().debug( "Duplicate found: " + targetFileName );
-            		targetFileName = artifact.getGroupId() + "-" + targetFileName;
-            		getLog().debug( "Renamed to: " + targetFileName );
-            	}
-
-            	// TODO: utilise appropriate methods from project builder
-            	ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
-            	if ( !artifact.isOptional() && filter.include( artifact ) )
-            	{
-            		String type = artifact.getType();
-            		if ( "jar".equals( type ) )
-            		{
-            			copyFileIfModified( artifact.getFile(), new File( libDir, targetFileName ) );
-            		}
-            	}
+            if(includeDependencies){
+                Set artifacts = project.getArtifacts();
+    
+                List duplicates = findDuplicates( artifacts );
+    
+                for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
+                {
+                	Artifact artifact = (Artifact) iter.next();
+                	String targetFileName = getDefaultFinalName( artifact );
+    
+                	getLog().debug( "Processing: " + targetFileName );
+    
+                	if ( duplicates.contains( targetFileName ) )
+                	{
+                		getLog().debug( "Duplicate found: " + targetFileName );
+                		targetFileName = artifact.getGroupId() + "-" + targetFileName;
+                		getLog().debug( "Renamed to: " + targetFileName );
+                	}
+    
+                	// TODO: utilise appropriate methods from project builder
+                	ScopeArtifactFilter filter = new ScopeArtifactFilter( Artifact.SCOPE_RUNTIME );
+                	if ( !artifact.isOptional() && filter.include( artifact ) )
+                	{
+                		String type = artifact.getType();
+                		if ( "jar".equals( type ) )
+                		{
+                			copyFileIfModified( artifact.getFile(), new File( libDir, targetFileName ) );
+                		}
+                	}
+                }
             }
         }
         catch ( IOException e )

Modified: webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src/site/apt/configuration.apt
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src/site/apt/configuration.apt?view=diff&rev=478629&r1=478628&r2=478629
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src/site/apt/configuration.apt (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-mar-maven-plugin/src/site/apt/configuration.apt Thu Nov 23 10:18:55 2006
@@ -2,22 +2,25 @@
 
   All Mar plugin goals takes the following configuration parameters as input:
 
-*------------------+----------------------------------+------------------------------------------------+
-| Parameter name   | Default value                    | Description                                    |
-*------------------+----------------------------------+------------------------------------------------+
-| marDirectory     | ${project.build.directory}/mar   | Directory where the mar file is built.         |
-*------------------+----------------------------------+------------------------------------------------+
-| classesDirectory | ${project.build.outputDirectory} | Directory with compiled classes and resources. |
-*------------------+----------------------------------+------------------------------------------------+
-| fileSets         |                                  | Additional file sets, which are being added to |
-|                  |                                  | the archive. See "File Sets" below for an      |
-|                  |                                  | example.                                       |
-*------------------+----------------------------------+------------------------------------------------+
-| moduleXmlFile    |                                  | Location of the module.xml file. By default,   |
-|                  |                                  | it is assumed that the file is already present |
-|                  |                                  | in classesDirectory/META-INF and no special    |
-|                  |                                  | processing is required.                        |
-*------------------+----------------------------------+------------------------------------------------+
+*---------------------+----------------------------------+------------------------------------------------+
+| Parameter name      | Default value                    | Description                                    |
+*---------------------+----------------------------------+------------------------------------------------+
+| marDirectory        | ${project.build.directory}/mar   | Directory where the mar file is built.         |
+*---------------------+----------------------------------+------------------------------------------------+
+| classesDirectory    | ${project.build.outputDirectory} | Directory with compiled classes and resources. |
+*---------------------+----------------------------------+------------------------------------------------+
+| fileSets            |                                  | Additional file sets, which are being added to |
+|                     |                                  | the archive. See "File Sets" below for an      |
+|                     |                                  | example.                                       |
+*---------------------+----------------------------------+------------------------------------------------+
+| moduleXmlFile       |                                  | Location of the module.xml file. By default,   |
+|                     |                                  | it is assumed that the file is already present |
+|                     |                                  | in classesDirectory/META-INF and no special    |
+|                     |                                  | processing is required.                        |
+*---------------------+----------------------------------+------------------------------------------------+
+| includeDependencies | true                             | Whether to include the project dependencies in |
+|                     |                                  | the generated mar.                             |
+*---------------------+----------------------------------+------------------------------------------------+
 
 
 The mar goal



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org