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

Andrius Karpavicius commented on MNG-748:
-----------------------------------------

During War packaging phase compiled classes are placed in WEB-INF/classes 
directory. I want them to be jar'ed and placed in WEB-INF/lib as a single JAR.

Therefore before war package, I jar "classes" directory and place file in 
WEB-INF/lib.

By default JAR plugin packages "classes" directory and places jar in a "target" 
directory (${project.build.directory}) , where as I need it to be 
"WEB-INF/lib", therefore in my plugin configuration I overwride a <basedir> 
parameter.

I correct myself, maven-jar-plugin <outputDirectory> can be the way it is for 
this case, however if looking from a perspective to be able to use plugin to 
jar anything from anywhere to anywhere, all properties should be edit enabled.

Here is a section on my pom.xml

     <!-- Jar plugin configuration to jar class files and place into 
/WEB-INF/lib directory. 
          Should run before the packaging phase, therefore phase is set to 
"test"
          This required a modification in maven-jar-plugin/plugin.xml file to 
edit enable "basedir" properties
      -->
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-jar-plugin</artifactId>
       <executions>
         <execution>
           <phase>test</phase>
           <goals>
             <goal>jar</goal>
           </goals>
           <configuration>
             
<basedir>${project.build.directory}/${project.build.finalName}/WEB-INF/lib</basedir>
           </configuration>
          </execution>
        </executions>
      </plugin>



Another change was to be able to overwrite a "classesDirectory" for war plugin. 
I wanted to point to something non existing, so it would not package classes 
directory if I already packaged them to a JAR (issue above).

But turns out that if a not existing directory is specified, a default value is 
taken, and classes directory is packed anyway. Here I made a temporary quick 
solution by commenting in WarMojo.java section of code.


Anyway, if loking from a bigger picture, a need is to have a Jar within War, 
instead of loose classes.

> Edit enable maven-war-plugin and maven-jar-plugin properties
> ------------------------------------------------------------
>
>          Key: MNG-748
>          URL: http://jira.codehaus.org/browse/MNG-748
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-plugins
>     Versions: 2.0-beta-1
>     Reporter: Andrius Karpavicius
>     Priority: Minor

>
> Original Estimate: 5 minutes
>         Remaining: 5 minutes
>
> Please edit enable the following properties in plugin.xml file:
> maven-war-plugin:
> <classesDirectory>
> maven-jar-plugin
> <outputDirectory>
> <basedir>

-- 
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