[ http://jira.codehaus.org/browse/MNG-826?page=comments#action_45751 ] 

Edward Yakop commented on MNG-826:
----------------------------------

Hi,

I'm sorry for the *assigneed* directly, I accidentally cloned a jira issued on 
similar problem last night.

Now, in regards to the problem:
If we have a project like the sample project provided by this link
http://jira.codehaus.org/browse/MNG-743

Let's simplify ear/pom.xml to:
<project>
   <modelVersion>4.0.0</modelVersion>
   <groupId>root.project</groupId>
   <artifactId>ear</artifactId>
   <packaging>ear</packaging>
   <version>1.0</version>
   <name>ear assembly</name>
   <parent>
      <groupId>root</groupId>
      <artifactId>project</artifactId>
      <version>1.0</version>
   </parent>
   <dependencies>
      <dependency>
         <groupId>root.project</groupId>
         <artifactId>ejbs</artifactId>
         <type>ejb</type>
      </dependency>
      <dependency>
         <groupId>root.project.servlets</groupId>
         <artifactId>servlet</artifactId>
         <type>war</type>
      </dependency>
   </dependencies>
   <build>
      <plugins>
         <plugin>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
               <archive>
                  <manifest>
                     <addClasspath>true</addClasspath>
                  </manifest>
               </archive>
            </configuration>
         </plugin>
      </plugins>
   </build>
</project>

When "m2 package" is invoked the generated target/application.xml:
<application>
  <display-name>ear</display-name>
  <module>
    <java>fop-0.20.5.jar</java>
  </module>
  <module>
    <java>primary-source-1.0.jar</java>
  </module>
  <module>
    <java>logging-1.0.jar</java>
  </module>
  <module>
    <web>
      <web-uri>servlet-1.0.war</web-uri>
      <context-root>/servlet</context-root>
    </web>
  </module>
  <module>
    <ejb>ejbs-1.0.jar</ejb>
  </module>
</application>

The problem here is logging-1.0.jar, primary-source-1.0.jar, fop-0.20.5.jar are 
not ejb-client of ejbs-1.0.jar. Hence these jars shouldn't be mentioned inside 
application.xml and should be identified as library by default.

Now, the next question would be, how are we going to identify ejb-client or 
standard library without modifying any ear pom.xml
I.e.
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
            <javaModule>
              <groupId>group1</groupId>
              <artifactId>ejbClient1</artifactId>
            </javaModule>
          </modules>
        </configuration>
      </plugin>
    </plugins>
  </build>

Would it be nicer if we have ejb-client type for example? hence, all we have to 
do is by adding an extra node inside <dependency> (i.e. <dependency> ... 
<type>ejb-client</type></dependency> for ejb-client or blank for standard 
library) or use another <packaging> type inside ejb pom.xml, that way we can 
skip the <build> node all together :)

Regards,
Edward

> Improve the declaration of 3rd party library and exclusion
> ----------------------------------------------------------
>
>          Key: MNG-826
>          URL: http://jira.codehaus.org/browse/MNG-826
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-plugins
>     Reporter: Edward Yakop
>     Assignee: Stephane Nicoll

>
>
> Improvment of the exclusion/inclusion mechanism: for now this is working 
> based on dependencies wich are neither test nor provided. Need also to handle 
> jar modules which needs to be declared in a
> <module>
>   <java>[...]</java>
> </module>
> entry. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to