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 ru...@apache.org on 2007/03/11 09:04:19 UTC

svn commit: r516868 - /webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java

Author: ruchithf
Date: Sun Mar 11 00:04:18 2007
New Revision: 516868

URL: http://svn.apache.org/viewvc?view=rev&rev=516868
Log:
Use "includeDependencies" to decide whether to include deps in the aar file or not.


Modified:
    webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java

Modified: webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java?view=diff&rev=516868&r1=516867&r2=516868
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java Sun Mar 11 00:04:18 2007
@@ -105,6 +105,13 @@
      * @parameter
      */
     private FileSet[] fileSets;
+    
+    /**
+     * Whether the dependency jars should be included in the aar
+     * 
+     * @parameter expression="${includeDependencies}" default-value="true"
+     */
+    private boolean includeDependencies;
 
     /**
      * Builds the exploded AAR file.
@@ -154,34 +161,35 @@
             copyMetaInfFile( servicesXmlFile, servicesFileTarget, existsBeforeCopyingClasses, "services.xml file" );
             copyMetaInfFile( wsdlFile, wsdlFileTarget, wsdlExistsBeforeCopyingClasses, "WSDL file" );
 
-            Set artifacts = project.getArtifacts();
-
-            List duplicates = findDuplicates( artifacts );
+            if(includeDependencies){
+                Set artifacts = project.getArtifacts();
 
-            for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
-            {
-            	Artifact artifact = (Artifact) iter.next();
-            	String targetFileName = getDefaultFinalName( artifact );
-
-            	getLog().debug( "Processing: " + targetFileName );
+                List duplicates = findDuplicates(artifacts);
 
-            	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 ) );
-            		}
-            	}
+                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 )



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