Hi,

Here is what I did to get the same zip using the maven-assembly-plugin:

1) Configure the tuscany-zip-plugin in the pom.xml for the archetype (https://svn.apache.org/repos/asf/tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml)

   <plugin>
       <artifactId>maven-assembly-plugin</artifactId>
       <configuration>
         <descriptors>
           <descriptor>src/main/assembly/zip.xml</descriptor>
         </descriptors>
       </configuration>
 </plugin>

2) Add the assembly descriptor (src/main/assembly/zip.xml) to the archetype:
<assembly>
 <id>zip-contribution</id>
 <formats>
   <format>zip</format>
 </formats>
 <includeBaseDirectory>false</includeBaseDirectory>
 <dependencySets>
   <dependencySet>
     <unpack>false</unpack>
     <scope>runtime</scope>
     <outputDirectory>lib</outputDirectory>
     <useProjectArtifact>false</useProjectArtifact>
   </dependencySet>
 </dependencySets>
 <fileSets>
   <fileSet>
     <directory>${project.build.outputDirectory}</directory>
     <outputDirectory>/</outputDirectory>
   </fileSet>
 </fileSets>
</assembly>

3) Use mvn archetype:generate to generate a project from the archetype

4) Run mvn assembly:assembly to produce the zip (This can be automated into the default build)

Thanks,
Raymond
--------------------------------------------------
From: "ant elder" <[email protected]>
Sent: Tuesday, April 28, 2009 8:48 AM
To: <[email protected]>
Subject: Re: [VOTE] Release Tuscany Zip Plugin alpha1

On Tue, Apr 28, 2009 at 4:36 PM, Raymond Feng <[email protected]> wrote:
Hi,

Thanks Mike for the great document. It helps me understand what the zip
plugin does.

But now I have a new question:

Can we just use the the maven assembly plugin to package them into a zip?
The pom will look like:

<project>
 [...]
 <build>
  [...]
  <plugins>
    <plugin>
<!-- NOTE: We don't need a groupId specification because the group is
           org.apache.maven.plugins ...which is assumed by default.
       -->
      <artifactId>maven-assembly-plugin</artifactId>
      <configuration>
        <descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef> <!-- This is
a predefined descriptor, see [2] -->
        </descriptorRefs>
      </configuration>
      [...]
</project>

[1] http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
[2]
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies

IMO, developing our own maven plugin will be the last resort.


I don't think its the last resort, if we can make it simpler for users
with our own plugin then thats a good thing and worth doing. The
plugin is just a side effect of the main goal which is to have an easy
way to create sca zip contributions and to use that in the
contribution-zip archetype, if you think there's an easier way to do
that that thats great, could you show us with an actual example? I've
just updated the contribution-zip archetype to use a calculator type
service which uses a dependency jar so you could try updating that to
use you new approach, if that does turn out to be simpler then I'm all
for it.

...ant

Reply via email to