Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 12706 invoked from network); 27 Oct 2006 20:34:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Oct 2006 20:34:03 -0000 Received: (qmail 62843 invoked by uid 500); 27 Oct 2006 20:34:14 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 62738 invoked by uid 500); 27 Oct 2006 20:34:14 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 62703 invoked by uid 500); 27 Oct 2006 20:34:14 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 62696 invoked by uid 99); 27 Oct 2006 20:34:14 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Oct 2006 13:34:13 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Oct 2006 13:34:00 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 90E5F1A9846; Fri, 27 Oct 2006 13:33:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r468524 - in /webservices/axis2/branches/java/1_1: ./ modules/parent/ modules/tool/ modules/tool/axis2-aar-maven-plugin/ modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/ modules/tool/axis2-aar-maven-plugin/src/... Date: Fri, 27 Oct 2006 20:33:39 -0000 To: axis2-cvs@ws.apache.org From: jochen@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061027203339.90E5F1A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jochen Date: Fri Oct 27 13:33:38 2006 New Revision: 468524 URL: http://svn.apache.org/viewvc?view=rev&rev=468524 Log: Work on the docs for the axís2-aar-maven-plugin. Added: webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/configuration.apt Modified: webservices/axis2/branches/java/1_1/modules/parent/pom.xml webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/pom.xml webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/FileSet.java webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/howto.apt webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/site.xml webservices/axis2/branches/java/1_1/modules/tool/pom.xml webservices/axis2/branches/java/1_1/pom.xml Modified: webservices/axis2/branches/java/1_1/modules/parent/pom.xml URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/parent/pom.xml?view=diff&rev=468524&r1=468523&r2=468524 ============================================================================== --- webservices/axis2/branches/java/1_1/modules/parent/pom.xml (original) +++ webservices/axis2/branches/java/1_1/modules/parent/pom.xml Fri Oct 27 13:33:38 2006 @@ -19,6 +19,11 @@ 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/maven-v4_0_0.xsd"> + + org.apache + apache + 3 + 4.0.0 org.apache.axis2 axis2-parent @@ -66,9 +71,9 @@ - scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java - scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java - http://svn.apache.org/viewvc/webservices/axis2/trunk/java + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/branches/java/1_1 + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/branches/java/1_1 + http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1 Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/pom.xml URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/pom.xml?view=diff&rev=468524&r1=468523&r2=468524 ============================================================================== --- webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/pom.xml (original) +++ webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/pom.xml Fri Oct 27 13:33:38 2006 @@ -22,12 +22,14 @@ org.apache.axis2.maven2 axis2-maven-tools - 1.1-SNAPSHOT + 1.1-SNAPSHOT + ../pom.xml 4.0.0 axis2-aar-maven-plugin maven-plugin Axis 2 Aar Maven Plugin + A Maven 2 plugin for creating Axis 2 service archives (aar files) @@ -54,4 +56,39 @@ maven-artifact + + + + jochen + Jochen Wiedmann + jochen.wiedmann@gmail.com + + + + + + John Pfeifer + john.pfeifer@hnpsolutions.com + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + org.apache.maven.plugins + maven-changes-plugin + + + + changes-report + + + + + + Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java?view=diff&rev=468524&r1=468523&r2=468524 ============================================================================== --- webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java (original) +++ webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java Fri Oct 27 13:33:38 2006 @@ -38,7 +38,6 @@ */ public class AarMojo extends AbstractAarMojo { - /** * The directory for the generated aar. * Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java?view=diff&rev=468524&r1=468523&r2=468524 ============================================================================== --- webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java (original) +++ webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java Fri Oct 27 13:33:38 2006 @@ -18,7 +18,13 @@ import java.io.File; import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; @@ -115,6 +121,7 @@ try { final File metaInfDir = new File( aarDirectory, "META-INF" ); + final File libDir = new File(aarDirectory, "lib"); final File servicesFileTarget = new File( metaInfDir, "services.xml" ); boolean existsBeforeCopyingClasses = servicesFileTarget.exists(); @@ -146,13 +153,107 @@ copyMetaInfFile( servicesXmlFile, servicesFileTarget, existsBeforeCopyingClasses, "services.xml file" ); copyMetaInfFile( wsdlFile, wsdlFileTarget, wsdlExistsBeforeCopyingClasses, "WSDL 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 ) ); + } + } + } + } catch ( IOException e ) { throw new MojoExecutionException( "Could not explode aar...", e ); } } + /** + * Searches a set of artifacts for duplicate filenames and returns a list of duplicates. + * + * @param artifacts set of artifacts + * @return List of duplicated artifacts + */ + private List findDuplicates( Set artifacts ) + { + List duplicates = new ArrayList(); + List identifiers = new ArrayList(); + for ( Iterator iter = artifacts.iterator(); iter.hasNext(); ) + { + Artifact artifact = (Artifact) iter.next(); + String candidate = getDefaultFinalName( artifact ); + if ( identifiers.contains( candidate ) ) + { + duplicates.add( candidate ); + } + else + { + identifiers.add( candidate ); + } + } + return duplicates; + } + + /** + * Converts the filename of an artifact to artifactId-version.type format. + * + * @param artifact + * @return converted filename of the artifact + */ + private String getDefaultFinalName( Artifact artifact ) + { + return artifact.getArtifactId() + "-" + artifact.getVersion() + "." + + artifact.getArtifactHandler().getExtension(); + } + + /** + * Copy file from source to destination only if source timestamp is later than the destination timestamp. + * The directories up to destination will be created if they don't already exist. + * destination will be overwritten if it already exists. + * + * @param source An existing non-directory File to copy bytes from. + * @param destination A non-directory File to write bytes to (possibly + * overwriting). + * @throws IOException if source does not exist, destination cannot be + * written to, or an IO error occurs during copying. + * @throws java.io.FileNotFoundException if destination is a directory + *

+ * TO DO: Remove this method when Maven moves to plexus-utils version 1.4 + */ + private void copyFileIfModified( File source, File destination ) + throws IOException + { + // TO DO: Remove this method and use the method in WarFileUtils when Maven 2 changes + // to plexus-utils 1.2. + if ( destination.lastModified() < source.lastModified() ) + { + FileUtils.copyFile( source.getCanonicalFile(), destination ); + // preserve timestamp + destination.setLastModified( source.lastModified() ); + } + } private void copyFileSet( FileSet fileSet, File targetDirectory ) throws IOException @@ -174,7 +275,7 @@ DirectoryScanner ds = new DirectoryScanner(); ds.setBasedir( dir ); - if ( !fileSet.isSuppressDefaultExcludes() ) + if ( !fileSet.isSkipDefaultExcludes() ) { ds.addDefaultExcludes(); } Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/FileSet.java URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/FileSet.java?view=diff&rev=468524&r1=468523&r2=468524 ============================================================================== --- webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/FileSet.java (original) +++ webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/FileSet.java Fri Oct 27 13:33:38 2006 @@ -30,7 +30,7 @@ private File directory; private String outputDirectory; private String[] includes, excludes; - private boolean suppressDefaultExcludes; + private boolean skipDefaultExcludes; /** * Returns the file sets base directory. May be omitted, in which @@ -104,17 +104,17 @@ * Returns, whether the default excludes should be used. Defaults * to true. */ - public boolean isSuppressDefaultExcludes() + public boolean isSkipDefaultExcludes() { - return suppressDefaultExcludes; + return skipDefaultExcludes; } /** * Sets, whether the default excludes should be used. Defaults to * true. */ - public void setSuppressDefaultExcludes( boolean suppressDefaultExcludes ) + public void setSkipDefaultExcludes( boolean skipDefaultExcludes ) { - this.suppressDefaultExcludes = suppressDefaultExcludes; + this.skipDefaultExcludes = skipDefaultExcludes; } } Added: webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/configuration.apt URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/configuration.apt?view=auto&rev=468524 ============================================================================== --- webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/configuration.apt (added) +++ webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/configuration.apt Fri Oct 27 13:33:38 2006 @@ -0,0 +1,105 @@ +Configuration + + All Aar plugin goals takes the following configuration parameters as input: + +*------------------+----------------------------------+------------------------------------------------+ +| Parameter name | Default value | Description | +*------------------+----------------------------------+------------------------------------------------+ +| aarDirectory | ${project.build.directory}/aar | Directory where the aar 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. | +*------------------+----------------------------------+------------------------------------------------+ +| servicesXmlFile | | Location of the services.xml file. By default, | +| | | it is assumed that the file is already present | +| | | in classesDirectory/META-INF and no special | +| | | processing is required. | +*------------------+----------------------------------+------------------------------------------------+ +| wsdlFile | | Location of the WSDL file. By default, it is | +| | | assumed that the file is already present in | +| | | classesDirectory/META-INF and no special | +| | | processing is required. | +*------------------+----------------------------------+------------------------------------------------+ +| wsdlFileName | service.wsdl | Name, to which the WSDL file should be mapped. | +*------------------+----------------------------------+------------------------------------------------+ + + +The aar goal + + The aar goal allows the following additional parameters: + +*------------------+----------------------------+------------------------------------------------+ +| Parameter name | Default value | Description | +*------------------+----------------------------+------------------------------------------------+ +| outputDirectory | ${project.build.directory} | Directory where to generate the AAR file. | +*------------------+----------------------------+------------------------------------------------+ +| aarName | ${project.build.finalName} | The generated AAR files name. | +*------------------+----------------------------+------------------------------------------------+ +| archive | | A Maven archive configuration. This allows, | +| | | for example, to configure the MANIFEST.MF | +| | | file. | +*------------------+----------------------------+------------------------------------------------+ +| classifier | | A classifier, which should be added to the | +| | | generated AAR files name. Setting this | +| | | parameter has the side effect, that the | +| | | artifact is treated as an attachment and not | +| | | as the projects primary artifact. | +*------------------+----------------------------+------------------------------------------------+ +| primaryArtifact | true | Setting this property to false disables | +| | | installation or deployment of the artifact as | +| | | the projects primary artifact. | +*------------------+----------------------------+------------------------------------------------+ + + +File Sets + + Additional file sets may be configured for inclusion into the AAR file. A file set looks + as follows: + +----------------- + + + src/aar/files + META-INF/docs + + **/*.html + + + + src/aar/files + META-INF/etc + + **/*.html + + + +----------------- + + The example specifies, that the contents of the directory src/aar/files shall + be added to the AAR file. HTML files will go into META-INF/docs, all other + files to META-INF/etc. + + A file set is configured through the following configuration parameters: + +*---------------------+-------------------------------------------------------------------+ +| Parameter name | Description | +*---------------------+-------------------------------------------------------------------+ +| directory | The directory, from which to read the file set. This parameter is | +| | required. | +*---------------------+-------------------------------------------------------------------+ +| outputDirectory | The target directory within the AAR file. Defaults to the AAR | +| | files root directory. | +*---------------------+-------------------------------------------------------------------+ +| includes | Configures the set of files, which shall be included into the AAR | +| | file. Defaults to **/*. | +*---------------------+-------------------------------------------------------------------+ +| excludes | Configures a set of files, which shall be excluded from the file | +| | set. Defaults to the Maven default excludes (**/*~, **/cvs/**/*, | +| | **/.svn/**/*, etc.) | +*---------------------+-------------------------------------------------------------------+ +| skipDefaultExcludes | If this parameter is set to true, then no default excludes are | +| | being used. | +*---------------------+-------------------------------------------------------------------+ Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/howto.apt URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/howto.apt?view=diff&rev=468524&r1=468523&r2=468524 ============================================================================== --- webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/howto.apt (original) +++ webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/howto.apt Fri Oct 27 13:33:38 2006 @@ -16,7 +16,7 @@ * exploded : package an exploded aar application Each mode is materialized by a goal. For instance, to generate an exploded - sar from the current project, one would type + aar from the current project, one would type +-------- mvn aar:exploded Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/site.xml URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/site.xml?view=diff&rev=468524&r1=468523&r2=468524 ============================================================================== --- webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/site.xml (original) +++ webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/site.xml Fri Oct 27 13:33:38 2006 @@ -30,11 +30,13 @@ +

- + + ${reports} Modified: webservices/axis2/branches/java/1_1/modules/tool/pom.xml URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/pom.xml?view=diff&rev=468524&r1=468523&r2=468524 ============================================================================== --- webservices/axis2/branches/java/1_1/modules/tool/pom.xml (original) +++ webservices/axis2/branches/java/1_1/modules/tool/pom.xml Fri Oct 27 13:33:38 2006 @@ -33,11 +33,19 @@ This is a set of Maven 2 plugins for working with Axis 2. pom + + + http://svn.apache.org/repos/asf/webservices/axis2/branches/java/1_1/modules/tool + https://svn.apache.org/repos/asf/webservices/axis2/branches/java/1_1/modules/tool + http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool + + axis2-aar-maven-plugin axis2-java2wsdl-maven-plugin axis2-wsdl2code-maven-plugin + Modified: webservices/axis2/branches/java/1_1/pom.xml URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/pom.xml?view=diff&rev=468524&r1=468523&r2=468524 ============================================================================== --- webservices/axis2/branches/java/1_1/pom.xml (original) +++ webservices/axis2/branches/java/1_1/pom.xml Fri Oct 27 13:33:38 2006 @@ -19,6 +19,11 @@ 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/maven-v4_0_0.xsd"> + + org.apache + apache + 3 + 4.0.0 org.apache.axis2 axis2 --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org