You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Marat Abrarov (Jira)" <ji...@apache.org> on 2022/01/12 11:49:00 UTC

[jira] [Comment Edited] (MEAR-307) skinny modules war libs are not put into shared lib directory

    [ https://issues.apache.org/jira/browse/MEAR-307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17474469#comment-17474469 ] 

Marat Abrarov edited comment on MEAR-307 at 1/12/22, 11:48 AM:
---------------------------------------------------------------

[~asbachb],

I'm not the author of this approach, but I believe it's by design - this way users have fine-grained control over what JARs / HARs / SARs / etc to move into shared folder and what keep as is. I was ensured that the trick I shared in [^MEAR-307_fixed_example.zip] is widely used and is simple to implement.

Refer to https://github.com/apache/maven-ear-plugin/pull/24. There are rare cases (e.g. some Spring Web libraries, JSF libraries) when you need to keep JAR inside WAR even if this JAR is located in multiple web modules of the same EAR (otherwise JAR doesn't work as expected).


was (Author: abrarovm):
[~asbachb],

I'm not the author of this approach, but I believe it's by design - this way users have fine-grained control over what JARs / WARs / etc to move into shared folder and what keep as is. I was ensured that the trick I shared in [^MEAR-307_fixed_example.zip] is widely used and is simple to implement.

Refer to https://github.com/apache/maven-ear-plugin/pull/24. There are rare cases (e.g. some Spring Web libraries, JSF libraries) when you need to keep JAR inside WAR even if this JAR is located in multiple web modules of the same EAR (otherwise JAR doesn't work as expected).

> skinny modules war libs are not put into shared lib directory
> -------------------------------------------------------------
>
>                 Key: MEAR-307
>                 URL: https://issues.apache.org/jira/browse/MEAR-307
>             Project: Maven EAR Plugin
>          Issue Type: Bug
>    Affects Versions: 3.2.0
>            Reporter: Benjamin Asbach
>            Priority: Major
>         Attachments: MEAR-307_fixed_example.zip, ear-war-skinny-bug-ear.zip
>
>
> {code:xml}
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-ear-plugin</artifactId>
>         <version>3.2.0</version>
>         <configuration>
>           <version>8</version>
>           <defaultLibBundleDir>libs/</defaultLibBundleDir>
>           <skinnyModules>true</skinnyModules>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <dependencies>
>     <dependency>
>       <groupId>org.jenkins-ci.main</groupId>
>       <artifactId>jenkins-war</artifactId>
>       <version>2.328</version>
>       <type>war</type>
>     </dependency>
>   </dependencies>
> {code}
> With the current configuration the libs of war application are not placed into libs directory. 
> This causes problems when you add an ejb module: The ejb dependencies are placed in libs and the META-INF/MANIFEST-MF classpath entry of the war is set with the libs classpath.
> This causes problems with classloading in JBoss EAP.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)