maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From poroto20 <porot...@gmail.com>
Subject Re: Maven copies 3 jars in lib folder (skinny war) for no reason
Date Mon, 03 Mar 2014 11:41:31 GMT
Hi Martin,

Thank you for your help.

I still cannot understand why those three jars are copied there. Two of
them they are not in the dependency tree at all, so the war should not need
them, and the other one (seam) is a depedency of other 4 artifacts, which
means that is also referenced from ouside the war so it should be on the
EAR lib.

Thanks


On 28 February 2014 11:54, Martin Hoeller [via Maven] <
ml-node+s40175n5786755h0@n5.nabble.com> wrote:

> Hi!
>
> This topic was just discussed yesterday:
>
> http://maven.40175.n5.nabble.com/Are-skinny-WARs-still-recommended-td5786626.html
>
> On 28 Feb 2014, poroto20 wrote:
>
> > I have one EAR project and I am trying to have a skinny war. It seems to
> be
> > working ok but for some reason it keeps copying 3 dependencies into
> war/lib
> > folder, which are commons-logging-1.0.4.jar, commons-codec-1.4.jar and
> > jboss-seam-2.2.1.Final.jar.
>
> The only dependencies to these artifacts seem to come from the WAR. So
> the m-ear-p needs not to extract them to the EAR.
>
> > I the EAR's pom I added `<skinnyWars>true</skinnyWars>`.
>
> That's correct!
>
> > I made sure I added
> > exclusions for those three jars, or they are `scope=provided`. I also
> added
> > `<packagingExcludes>**/*.jar</packagingExcludes>` in the WAR's pom file.
>
> You don't need to do anything in the WAR. The m-ear-p repackages the WAR,
> so it's entirely the responsibility of the m-ear-p.
>
> > I really can't understand maven's logic to create the war (or to copy
> those
> > jars).
>
> The m-ear-p tries to extract all JARs that are also referenced from
> outside the WAR to the EARs lib folder, so they can be reused by other
> modules in the EAR.
>
> Artifacts that are only used by the WAR should remain in the WAR.
>
> Artifacts that are JSF libraries (like RichFaces, OmniFaces, etc.) should
> also stay in the WAR because otherwise JSF won't scan them for
> initialization. See the link above for more details.
>
> > 1) When I run maven only for the WAR project, the WAR has no jars in
> /lib
> > folder
>
> Yes, but that's something completely different! The WAR will get
> re-packages by the m-ear-p if you configure skinnyWars for the m-ear-p.
>
> > 2) But when I run maven for all the projects (including the EAR) it
> copies
> > those 3 jars in the war file.
> >
> > What am I doing wrong? Why is different the WAR created with maven
> inside
> > the WAR project then for all projects (including EAR)? Please help
>
> hth,
> - martin
>
> *signature.asc* (205 bytes) Download Attachment<http://maven.40175.n5.nabble.com/attachment/5786755/0/signature.asc>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://maven.40175.n5.nabble.com/Maven-copies-3-jars-in-lib-folder-skinny-war-for-no-reason-tp5786736p5786755.html
>  To unsubscribe from Maven copies 3 jars in lib folder (skinny war) for no
> reason, click here<http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5786736&code=cG9yb3RvMjBAZ21haWwuY29tfDU3ODY3MzZ8LTEwOTA5NDE0ODI=>
> .
> NAML<http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://maven.40175.n5.nabble.com/Maven-copies-3-jars-in-lib-folder-skinny-war-for-no-reason-tp5786736p5786900.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message