Hi everyone!
Maybe you can help me out with this.

I want to build a executable jar file which must contain a war file within
(because I have included a jetty server runner in it). Problem is if I use
the predefined assembly descriptor to build it:
<descriptorRef>jar-with-dependencies</descriptorRef> in my main pom

the war file will not get copied into it.

If I write my own descriptor e.g.:
-------
<assembly>
  <id>jar-with-all-dependencies</id>
  <formats>
    <format>jar</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <dependencySets>
    <dependencySet>
        <unpack>true</unpack>
        <scope>runtime</scope>

        <unpackOptions>
            <excludes>
                <!--this doesnt work 100%....war file gets unpacked all the
time in the jar too...i dont know why-->
                <exclude>*:war</exclude>
            </excludes>
        </unpackOptions>

    </dependencySet>

      <dependencySet>
          <unpack>false</unpack>
        <scope>runtime</scope>
            <includes>
              <include>*:war:*</include>

            </includes>
      </dependencySet>


  </dependencySets>
  <fileSets>
    <fileSet>
      <directory>${project.build.outputDirectory}</directory>
    </fileSet>
  </fileSets>
</assembly>

------
the war file gets included but if I try to run the jar it cant find the main
class so if I extract it the directory structure is messed up e.g.  
executable class is not in root folder but in target/classes 

Also if I use the standard jar-with-dependencies descriptor code seen here:
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html

which is:
------
<assembly>
  <id>jar-with-dependencies</id>
  <formats>
    <format>jar</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <dependencySets>
    <dependencySet>
      <unpack>true</unpack>
      <scope>runtime</scope>
    </dependencySet>
  </dependencySets>
  <fileSets>
    <fileSet>
      <directory>${project.build.outputDirectory}</directory>
    </fileSet>
  </fileSets>
</assembly>
-----

it cant find the main class also it should be the same result as just using 
 <descriptorRef>jar-with-dependencies</descriptorRef>

in my main pom.

I am using maven2.

Thank you for your help
-- 
View this message in context: 
http://www.nabble.com/Using-custom-assembly-descriptor-tp24290434p24290434.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to