I'm using version 2.1 of maven-assembly-plugin.
The documentaion on the assembly saids I can have  unpackOptions tag in
the dependencySet but I get an "Unrecognised tag: 'unpackOptions' "
error.

Here's the stack trace:
org.apache.maven.lifecycle.LifecycleExecutionException: Error reading
descriptor
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:559)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:475)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:454)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:306)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:273)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.java:140)
        at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error reading
descriptor
        at
org.apache.maven.plugin.assembly.AbstractAssemblyMojo.getAssembly(Abstra
ctAssemblyMojo.java:839)
        at
org.apache.maven.plugin.assembly.AbstractAssemblyMojo.getAssembly(Abstra
ctAssemblyMojo.java:814)
        at
org.apache.maven.plugin.assembly.AbstractAssemblyMojo.readAssemblies(Abs
tractAssemblyMojo.java:742)
        at
org.apache.maven.plugin.assembly.AbstractAssemblyMojo.execute(AbstractAs
semblyMojo.java:233)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
nager.java:412)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:534)
        ... 16 more
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
Unrecognised tag: 'unpackOptions' (position: START_TAG seen
...</unpack>\r\n       \r\n
   <unpackOptions>... @11:23)
        at
org.apache.maven.plugins.assembly.model.io.xpp3.AssemblyXpp3Reader.parse
DependencySet(AssemblyXpp3Reader.java:638)
        at
org.apache.maven.plugins.assembly.model.io.xpp3.AssemblyXpp3Reader.parse
Assembly(AssemblyXpp3Reader.java:456)
        at
org.apache.maven.plugins.assembly.model.io.xpp3.AssemblyXpp3Reader.read(
AssemblyXpp3Reader.java:1717)
        at
org.apache.maven.plugins.assembly.model.io.xpp3.AssemblyXpp3Reader.read(
AssemblyXpp3Reader.java:1728)
        at
org.apache.maven.plugin.assembly.AbstractAssemblyMojo.getAssembly(Abstra
ctAssemblyMojo.java:829)
        ... 21 more

The pom:
<project 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";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>play.ejb</groupId>
  <artifactId>play-ejb</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>play-ejb</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring</artifactId>
      <version>2.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <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>
        <executions>
          <execution>
            <id>assembly</id>
            <phase>package</phase>
            <goals>
              <goal>assembly</goal>
            </goals>
        
        <configuration>
           <descriptors>
              <descriptor>src/assemble/src.xml</descriptor>
           </descriptors>
        </configuration>
         </execution>
        </executions>
       </plugin>
     </plugins>
  </build>

</project>

The assembly:
<assembly>
  <id>jar-with-dependencies</id>
  <formats>
    <format>jar</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <dependencySets>
    <dependencySet>
       <unpack>true</unpack>
       
       <unpackOptions>
          <excludes>
             <exclude>*.properties</exclude>
          </excludes>
        </unpackOptions>
        
    </dependencySet>
  </dependencySets>
  <fileSets>
    <fileSet>
      <directory>target/classes</directory>
    </fileSet>
  </fileSets>
</assembly>

Reply via email to