Author: veithen Date: Sun Jul 18 19:56:26 2010 New Revision: 965277 URL: http://svn.apache.org/viewvc?rev=965277&view=rev Log: Also refactored the build of the service archiver Eclipse plugin.
Added: axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/build.properties axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/help_toc.xml - copied unchanged from r965267, axis/axis2/java/core/trunk/modules/tool/conf/service/help_toc.xml axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/icons/ - copied from r965267, axis/axis2/java/core/trunk/modules/tool/conf/service/icons/ axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/plugin.xml - copied, changed from r965267, axis/axis2/java/core/trunk/modules/tool/conf/service/plugin.xml Removed: axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/build.xml axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/src/test/ Modified: axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/ (props changed) axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/eclipse-service-plugin-assembly.xml axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/pom.xml Propchange: axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Sun Jul 18 19:56:26 2010 @@ -1,3 +1,7 @@ axis2.eclipse.service.plugin.iml target - +META-INF +lib +.settings +.classpath +.project Added: axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/build.properties URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/build.properties?rev=965277&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/build.properties (added) +++ axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/build.properties Sun Jul 18 19:56:26 2010 @@ -0,0 +1,27 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + +source.. = src/main/java/,\ + target/maven-shared-archive-resources/ +output.. = target/classes/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + lib/,\ + help_toc.xml Modified: axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/eclipse-service-plugin-assembly.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/eclipse-service-plugin-assembly.xml?rev=965277&r1=965276&r2=965277&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/eclipse-service-plugin-assembly.xml (original) +++ axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/eclipse-service-plugin-assembly.xml Sun Jul 18 19:56:26 2010 @@ -23,40 +23,18 @@ <formats> <format>zip</format> </formats> - <fileSets> - <fileSet> - <directory>./target/classes</directory> - <outputDirectory>classes</outputDirectory> - </fileSet> - </fileSets> - <dependencySets> - <dependencySet> - <outputFileNameMapping>${artifactId}-${commons.logging.version}.${extension}</outputFileNameMapping> - <outputDirectory>lib</outputDirectory> - <includes> - <include>commons-logging:commons-logging:jar</include> - </includes> - </dependencySet> - <dependencySet> - <outputFileNameMapping>${artifactId}-${version}.${extension}</outputFileNameMapping> - <outputDirectory>lib</outputDirectory> - <includes> - <include>org.apache.axis2:axis2:jar</include> - </includes> - </dependencySet> - <dependencySet> - <outputFileNameMapping>${artifactId}-${log4j.version}.${extension}</outputFileNameMapping> - <outputDirectory>lib</outputDirectory> - <includes> - <include>log4j:log4j:jar</include> - </includes> - </dependencySet> - <dependencySet> - <outputFileNameMapping>${artifactId}-${ant.version}.${extension}</outputFileNameMapping> - <outputDirectory>lib</outputDirectory> - <includes> - <include>org.apache.ant:ant:jar</include> - </includes> - </dependencySet> - </dependencySets> + <dependencySets> + <dependencySet> + <!-- We only want to include the main artifact of the project --> + <useProjectArtifact>true</useProjectArtifact> + <includes> + <include>${project.groupId}:${project.artifactId}</include> + </includes> + <outputDirectory>plugins</outputDirectory> + <!-- Make sure that the name of the JAR in the distribution respects the naming + convention expected by Eclipse. The bundle-symbolic-name and + bundle-version variables are calculated by a Groovy script executed from the POM. --> + <outputFileNameMapping>${bundle-symbolic-name}_${bundle-version}.jar</outputFileNameMapping> + </dependencySet> + </dependencySets> </assembly> Copied: axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/plugin.xml (from r965267, axis/axis2/java/core/trunk/modules/tool/conf/service/plugin.xml) URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/plugin.xml?p2=axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/plugin.xml&p1=axis/axis2/java/core/trunk/modules/tool/conf/service/plugin.xml&r1=965267&r2=965277&rev=965277&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/tool/conf/service/plugin.xml (original) +++ axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/plugin.xml Sun Jul 18 19:56:26 2010 @@ -20,40 +20,7 @@ ~ under the License. --> -<plugin - id="Axis2_Service_Archiver" - name="Axis2 Service Maker" - version="@eclipse.plugins.version@" - provider-name="Apache Software Foundation" - class="org.apache.axis2.tool.service.eclipse.plugin.ServiceArchiver"> - - <runtime> - <library name="Axis_Service_Archiver.jar"> - <export name="*"/> - </library> - <library name="lib/axi...@version@.jar"> - <export name="*"/> - </library> - <library name="lib/commons-loggi...@commons.logging.version@.jar"> - <export name="*"/> - </library> - <library name="lib/log...@log4j.version@.jar"> - <export name="*"/> - </library> - <library name="lib/a...@ant.version@.jar"> - <export name="*"/> - </library> - </runtime> - - <requires> - <import plugin="org.eclipse.ui"/> - <import plugin="org.eclipse.ui.ide"/> - <import plugin="org.eclipse.core.runtime"/> - <import plugin="org.eclipse.core.resources"/> - <import plugin="org.apache.ant"/> - <import plugin="org.eclipse.jface.text"/> - </requires> - +<plugin> <extension point="org.eclipse.ui.newWizards"> <category Modified: axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/pom.xml?rev=965277&r1=965276&r2=965277&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/pom.xml (original) +++ axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-service-plugin/pom.xml Sun Jul 18 19:56:26 2010 @@ -30,47 +30,15 @@ </parent> <artifactId>axis2.eclipse.service.plugin</artifactId> <name>Apache Axis2 - tool - Eclipse service Plugin</name> + <packaging>bundle</packaging> <description>The Axis 2 Eclipse Service Plugin for Service archive creation</description> <dependencies> <dependency> <groupId>org.apache.axis2</groupId> - <artifactId>axis2</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-java2wsdl</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> <artifactId>axis2-codegen</artifactId> <version>${project.version}</version> </dependency> <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-kernel</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-adb</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-adb-codegen</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - </dependency> - <dependency> <groupId>org.eclipse.core</groupId> <artifactId>org.eclipse.core.runtime</artifactId> <exclusions> @@ -175,6 +143,14 @@ <exclude>**/*.java</exclude> </excludes> </resource> + <resource> + <directory>.</directory> + <includes> + <include>plugin.xml</include> + <include>icons/**</include> + <include>help_toc.xml</include> + </includes> + </resource> </resources> <plugins> <plugin> @@ -193,164 +169,116 @@ </executions> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> + <artifactId>maven-eclipse-plugin</artifactId> + <version>2.8</version> <configuration> - <source>1.5</source> - <target>1.5</target> + <!-- We don't use the PDE mode here because we don't want maven-eclipse-plugin to tamper with + the manifest generated by maven-bundle-plugin --> + <additionalBuildcommands> + <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand> + <buildcommand>org.eclipse.pde.SchemaBuilder</buildcommand> + </additionalBuildcommands> + <additionalProjectnatures> + <projectnature>org.eclipse.pde.PluginNature</projectnature> + </additionalProjectnatures> </configuration> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-assembly-plugin</artifactId> + <artifactId>maven-dependency-plugin</artifactId> + <version>2.1</version> <executions> <execution> - <id>distribution-package</id> - <phase>package</phase> + <!-- This copies the dependencies so that they can be located by Eclipse --> + <id>copy-dependencies</id> + <phase>process-sources</phase> <goals> - <goal>attached</goal> + <goal>copy-dependencies</goal> </goals> <configuration> - <descriptors> - <descriptor>${pom.basedir}/eclipse-service-plugin-assembly.xml</descriptor> - </descriptors> - <finalName>dist</finalName> + <outputDirectory>lib</outputDirectory> + <overWriteReleases>false</overWriteReleases> + <overWriteSnapshots>false</overWriteSnapshots> + <overWriteIfNewer>true</overWriteIfNewer> </configuration> </execution> </executions> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> + <artifactId>maven-clean-plugin</artifactId> + <version>2.3</version> + <configuration> + <filesets> + <fileset> + <directory>lib</directory> + </fileset> + <fileset> + <directory>META-INF</directory> + </fileset> + </filesets> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <version>2.1.0</version> + <extensions>true</extensions> + <configuration> + <!-- Produce the manifest in the location expected by Eclipse --> + <manifestLocation>META-INF</manifestLocation> + <instructions> + <!-- Embed all dependencies, except those which are provided by the Eclipse runtime --> + <Embed-Dependency>*;scope=compile|runtime;artifactId=!org.eclipse.*|commons-logging|wstx-asl|geronimo-activation_1.1_spec|geronimo-javamail_1.4_spec|geronimo-stax-api_1.0_spec|ant*</Embed-Dependency> + <Embed-Directory>lib</Embed-Directory> + <Embed-Transitive>true</Embed-Transitive> + <!-- Exclude imports that are actually not used --> + <Import-Package>!org.dom4j*,!nu.xom,!org.jdom*,!javax.portlet,!org.apache.commons.io*,*</Import-Package> + <Export-Package></Export-Package> + <Bundle-Name>Axis2 Service Maker</Bundle-Name> + <Bundle-Activator>org.apache.axis2.tool.service.eclipse.plugin.ServiceArchiver</Bundle-Activator> + <Bundle-SymbolicName>org.apache.axis2.eclipse.service.plugin;singleton:=true</Bundle-SymbolicName> + <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy> + <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment> + </instructions> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.gmaven</groupId> + <artifactId>gmaven-plugin</artifactId> <executions> <execution> - <id>package</id> + <id>extract-bundle-symbolicname-and-version</id> <phase>package</phase> + <goals> + <goal>execute</goal> + </goals> <configuration> - <tasks> - <property name="service.plugin.version" - value="Axis2_Service_Archiver_${eclipse.plugins.version}"/> - <property name="service.plugin.zip.name" - value="axis2-eclipse-service-archiver-wizard.zip"/> - <property name="service.plugin.jar.name" value="Axis_Service_Archiver.jar"/> - <property name="src" value="./src"/> - <property name="service.src.dir" value="../axis2-eclipse-service-plugin/src/main/java"/> - <property name="output" value="../target/eclipse_plugins"/> - <property name="output.target" value="${output}/release"/> - <property name="service.output.dir" value="${output}/service-archiver"/> - <property name="plugin.output.dir" value="${output}/plugin"/> - <property name="service.plugin.output.dir" - value="${plugin.output.dir}/${service.plugin.version}"/> - <property name="source.dir.name" value="src"/> - <property name="lib.dir.name" value="lib"/> - <property name="bin.dir.name" value="bin"/> - <property name="help.dir.name" value="help"/> - <property name="icons.dir.name" value="icons"/> - <property name="plugin.project.file.name" value=".project"/> - <property name="plugin.classpath.file.name" value=".classpath"/> - <property name="plugin.help.file.name" value="help_toc.xml"/> - <property name="service.resource.dir" value="../conf/service"/> - <property name="service.help.resource.file" - value="../../../modules/documentation/xdocs/tools/1_4/eclipse/servicearchiver-plugin.html"/> - <property name="service.help.images.dir" - value="../../../modules/documentation/xdocs/tools/1_4/eclipse/images"/> - <property name="axis2.lib.dir" value="../../../target/lib"/> - <!--Filter tockens for the copy command to filter the versions of external dependencies --> - <filter token="version" value="${project.version}"/> - <filter token="eclipse.plugins.version" value="${eclipse.plugins.version}"/> - <filter token="ant.version" value="${ant.version}"/> - <filter token="commons.logging.version" value="${commons.logging.version}"/> - <filter token="log4j.version" value="${log4j.version}"/> - - <!-- - If it is neccessary to create the eclipse project manually without using "mvn eclipse:eclipse" command uncomment the following section which copies - the required jars to the the project lib folder - --> - + <source> + import java.util.jar.Manifest - <property name="m2.local.repo" value="${settings.localRepository}"/> - <mkdir dir="./lib"/> - <copy todir="./lib" file="${m2.local.repo}/org/apache/ant/ant/${ant.version}/ant-${ant.version}.jar" /> - <copy todir="./lib" file="${m2.local.repo}/commons-logging/commons-logging/${commons.logging.version}/commons-logging-${commons.logging.version}.jar" /> - <copy todir="./lib" file="${m2.local.repo}/log4j/log4j/${log4j.version}/log4j-${log4j.version}.jar" /> - <copy todir="./lib" file="${m2.local.repo}/org/apache/axis2/axis2/${project.version}/axis2-${project.version}.jar" /> - - <mkdir dir="./icons"/> - <copy todir="./icons" overwrite="true"> - <fileset dir="../conf/service/icons" /> - </copy> - <copy todir="." file="../conf/service/build.properties" overwrite="true" filtering="on"/> - <copy todir="." file="../conf/service/help_toc.xml" overwrite="true"/> - <copy todir="." file="../conf/service/plugin.xml" overwrite="true" filtering="on"/> - <copy todir="." file="../conf/service/.classpath" overwrite="true" filtering="on"/> - <copy todir="." file="../conf/service/.project" overwrite="true" filtering="on"/> - <copy todir="." file="../conf/service/readme.txt" overwrite="true"/> - - <delete dir="./target/plugin/${service.plugin.version}"/> - <mkdir dir="./target/plugin/${service.plugin.version}"/> - <delete dir="./target/dist"/> - <mkdir dir="./target/dist"/> - <unzip src="./target/axis2.eclipse.service.plugin-${project.version}.jar" - dest="./target/plugin/${service.plugin.version}"/> - <!-- Copy to the same position with the filtering on--> - <copy todir="./target/plugin/${service.plugin.version}" filtering="on"> - <fileset dir="${service.resource.dir}"> - <include name="plugin.xml"/> - <include name="build.properties"/> - <include name="${plugin.classpath.file.name}"/> - </fileset> - </copy> - <!-- copy the help directory --> - <mkdir dir="./target/plugin/${service.plugin.version}/${help.dir.name}"/> - <mkdir dir="./target/plugin/${service.plugin.version}/${help.dir.name}/${icons.dir.name}"/> - <copy todir="./target/plugin/${service.plugin.version}/${help.dir.name}"> - <fileset file="${service.help.resource.file}"/> - </copy> - <copy todir="./target/plugin/${service.plugin.version}/${help.dir.name}/${icons.dir.name}"> - <fileset dir="${service.help.images.dir}"/> - </copy> - <!-- copy the icons--> - <mkdir dir="./target/plugin/${service.plugin.version}/${icons.dir.name}"/> - <copy todir="./target/plugin/${service.plugin.version}/${icons.dir.name}"> - <fileset dir="${service.resource.dir}/${icons.dir.name}"/> - </copy> - <!-- copy the lib files --> - <mkdir dir="./target/plugin/temp"/> - <unzip src="./target/dist-axis2-eclipse-service-plugin.zip" - dest="./target/plugin/temp"/> - <mkdir dir="./target/plugin/${service.plugin.version}/lib"/> - <copy todir="./target/plugin/${service.plugin.version}/lib"> - <fileset dir="./target/plugin/temp/lib"/> - </copy> - <delete dir="./target/plugin/temp"/> - - <!-- copy the other project files--> - <copy todir="./target/plugin/${service.plugin.version}"> - <fileset file="${service.resource.dir}/${plugin.project.file.name}"/> - <fileset file="${service.resource.dir}/${plugin.help.file.name}"/> - </copy> - <!-- copy the classes to classes directory--> - <mkdir dir="./target/plugin/${service.plugin.version}/classes"/> - <copy todir="./target/plugin/${service.plugin.version}/classes"> - <fileset dir="./target/plugin/${service.plugin.version}"> - <include name="**/org/**"/> - </fileset> - </copy> - <!--Zip the classes to a jar file --> - <zip destfile="./target/plugin/${service.plugin.version}/${service.plugin.jar.name}" - basedir="./target/plugin/${service.plugin.version}/classes" update="true"/> - <delete dir="./target/plugin/${service.plugin.version}/classes"/> - <!--Zip the eclipse plugin to the target/dist directory --> - <zip destfile="./target/dist/${service.plugin.zip.name}" basedir="./target/plugin" - update="true"/> - <delete dir="./target/temp"/> - <delete dir="./target/classes"/> - <delete dir="./target/test-classes"/> - </tasks> + Manifest manifest = new Manifest(new FileInputStream("META-INF/MANIFEST.MF")) + project.properties["bundle-symbolic-name"] = manifest.mainAttributes.getValue("Bundle-SymbolicName").find("^[^;]*") + project.properties["bundle-version"] = manifest.mainAttributes.getValue("Bundle-Version") + </source> </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>distribution-package</id> + <phase>package</phase> <goals> - <goal>run</goal> + <goal>attached</goal> </goals> + <configuration> + <descriptors> + <descriptor>${pom.basedir}/eclipse-service-plugin-assembly.xml</descriptor> + </descriptors> + <finalName>dist</finalName> + </configuration> </execution> </executions> </plugin>