You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Remijan <mj...@yahoo.com> on 2009/10/22 18:28:58 UTC

Loosing Main-Class: in JAR MANIFEST when creating 2 jars

When I have BOTH of these plugins configured, both JAR files get created however I do NOT get the Main-Class in the MANIFEST.  But when I comment out the second plugin configuration (which creates the jars with the rmi stubs) then the MANIFEST does contain Main-Class.  Any ideas?   

<build>
 <plugins>

    <!-- 
     | This plugin configuration is responsible for
     | setting the Main-Class manifest attribute of
     | the JAR file so it is self-executing.
     -->
     <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
         <configuration>
            <archive>
                <manifest>
                    <mainClass>org.ferris.jdj.timeserver.server.Main</mainClass>
                </manifest>    
            </archive>
         </configuration>                
     </plugin> 
             
    <!-- 
     | This plugin configuration is responsible for
     | creating a JAR file containing the RMI stub
     | classes and other server-provided classes which
     | RMI Clients need to use to talk to the RMI Server.
     --> 
      <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-jar-plugin</artifactId>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
             <configuration>
                 <classifier>client</classifier>
                 <finalName>${project.artifactId}-stubs-${project.version}</finalName>
                 <includes>
                     <include>**/*_Stub.class</include>
                     <include>**/SecondsListener.class</include>
                     <include>**/ServerClock.class</include>
                     <include>**/TimeMonitor.class</include>
                     <include>**/TimeServices.class</include>                            
                 </includes>
             </configuration>
            </execution>                            
          </executions>
      </plugin> 

 </plugins>
</build>

Re: Loosing Main-Class: in JAR MANIFEST when creating 2 jars

Posted by Wayne Fay <wa...@gmail.com>.
> When I have BOTH of these plugins configured, both
> JAR files get created however I do NOT get the Main-Class
> in the MANIFEST.  But when I comment out the second
> plugin configuration (which creates the jars with the rmi
> stubs) then the MANIFEST does contain Main-Class.  Any ideas?

You're doing it wrong.

You need to have ONE declaration of the plugin. Then inside the plugin
node, you can set up multiple executions each with their own
configuration.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org