You'll probably want to put your main class in a separate jar and then use
dependency:unpack-dependencies to unpack the main class

2009/6/2 nambi sankaran <[email protected]>

> Hi All
>
> I am trying to embed jetty into a war file, so that the war file becomes
> executable.
>    java -jar mywar.war
> will start jetty on port 8080. ie, Main-Class will start Jetty
> programmatically.
>
> To achieve this I have added configuration section for war plugin,
>
>     <build>
>         <finalName>testwar</finalName>
>         <plugins>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                     <archive>
>                         <manifest>
>                             <mainClass>TestMain</mainClass>
>                         </manifest>
>                     </archive>
>                 </configuration>
>             </plugin>
>         </plugins>
>     </build>
>
>
> This results in correct MANIFEST.MF file, with the following entry
>         Main-Class : TestMain
>
> Howvever,  TestMain class is coped to WEB-INF/classes directory
> To make the war executable, the TestMain should be at the root level of war
> file.
>
> The war plugin documentation doesn't provide enough information how to
> configure the plugin, to copy "Main-Class"  to root level.
>
> Have anyone come across this issue?
>
> Thanks
> Nambi
>
>

Reply via email to