maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Wheeler <rwhee...@artifact-software.com>
Subject Re: Using shaded JAR as a dependency in a WAR module
Date Fri, 05 Dec 2014 04:41:15 GMT
We do this all the time and it always works.
http://blog.artifact-software.com/tech/?p=121 Aggregation jars make development simpler and
wars smaller


Partial dependencies for org.mdeggers:iforeclosure:1.0-SNAPSHOT:war

<dependencies>
     <dependency>
         <groupId>org.mdeggers</groupId>
         <artifactId>IFCResources</artifactId>
         <version>1.0-SNAPSHOT</version>
     </dependency>
</dependencies>

What are the dependencies for the war file? Partial list is not much help.

Ron


On 04/12/2014 6:29 PM, Mark Eggers wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Folks,
>
> I admit it, I'm a bit confused (and relatively new to maven).
>
> Goal:
>
> To release a WAR file with a minimal number of JAR files in WEB-INF/lib.
>
> Thought:
>
> 1. Break up the WAR project into a WAR module and a JAR module
> 2. Make the WAR module be dependent on the JAR module
> 3. Use the Maven shade plugin in the JAR module to create a shaded JAR
> 4. Drive the entire project with an agregator pom.xml
>
> The JAR module does shade properly, creating a single JAR with all of
> the dependencies bundled into a single JAR. It uses a pom dependency
> to gather in most of its requirements. None of the JAR or pom
> dependencies have further dependencies, so the resulting JAR is
> self-contained.
>
> However, when I build the WAR file and reference the shaded JAR file
> as a dependency, I do not get the shaded JAR file in WEB-INF/lib.
> Instead, I get all of the dependencies as individual JAR files in
> WEB-INF/lib.
>
> I'm using the following environment (can post my complete pom.xml
> files if needed).
>
> OS:    Fedora Linux 64 bit - latest updates
> JDK:   1.7.0_72 64 bit
> Maven: 3.2.3
>
> maven-shade-plugin: 2.3
> maven-war-plugin:   2.4
>
> shade configuration and dependencies for
> org.mdeggers:IFCResources:1.0-SNAPSHOT
>
> <properties>
>      <calhost.version>1.0-SNAPSHOT</calhost.version>
>      <ihomeresources.version>1.0-SNAPSHOT</ihomeresources.version>
> </properties>
>
> <dependencies>
>      <dependency>
>          <groupId>org.mdeggers</groupId>
>          <artifactId>Calhost</artifactId>
>          <version>${calhost.version}</version>
>      </dependency>
>      <dependency>
>          <groupId>org.mdeggers</groupId>
>          <artifactId>IHomeResources</artifactId>
>          <version>${ihomeresources.version}</version>
>          <type>pom</type>
>      </dependency>
> </dependencies>
>
> <plugin>
>      <groupId>org.apache.maven.plugins</groupId>
>      <artifactId>maven-shade-plugin</artifactId>
>      <version>2.3</version>
>      <executions>
>          <execution>
>              <id>combine</id>
>              <phase>package</phase>
>              <goals>
>                  <goal>shade</goal>
>              </goals>
>              <configuration>
>                  <artifactSet>
>                      <includes>
>                          <include>org.mdeggers:*</include>
>                      </includes>
>                  </artifactSet>
>              </configuration>
>           </execution>
>      </executions>
> </plugin>
>
> Partial dependencies for org.mdeggers:iforeclosure:1.0-SNAPSHOT:war
>
> <dependencies>
>      <dependency>
>          <groupId>org.mdeggers</groupId>
>          <artifactId>IFCResources</artifactId>
>          <version>1.0-SNAPSHOT</version>
>      </dependency>
> </dependencies>
>
> Parent pom modules section:
>
> <modules>
>      <module>IFCResources</module>
>      <module>iforeclosure</module>
> </modules>
>
> I'm obviously missing something here. Thoughts, corrections, pointers
> are all appreciated.
>
> I know, using a shaded JAR as a dependency is probably not best
> practice. However, the resulting WAR file is an end product and the
> shaded JAR only contains internal components from other web overlays
> used to build the final war.
>
> . . . just my (confused) 2 cents
> /mde/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQEcBAEBAgAGBQJUgO5LAAoJEEFGbsYNeTwt9YgIAKLuOll7rpDRI4Ea3ieshWgY
> HugkUrvaja1UZdKkFm0bdo4qQxUUmKHL9byHTQzPiLb6+WKeXaaQaMDvhA0DgbAp
> tJQ+4WKEPBzKx5MUvftY2oEiW8eVEnMIkZ6qLA0aPKxrenodlekz3eKlxJ/D8kxF
> dqf5UvncIYGNlzbThVlFaOpmp7FgF6dStrBDPuyGdhcLWpb4UkI/sVqo92/copnY
> tMR2uX9/Uscn+11pXlcTTg+YfGGwlguZIEkSBRlUBiAYMwiDG0fyDqRaVcv18BtS
> /iLB6hlB8xNkRArvIpDV+h7W2sHK6jekjzfCU80ZO72ZSgsiYUKMqWlY04GlPTU=
> =jCy7
> -----END PGP SIGNATURE-----
>
> ---
> This email is free from viruses and malware because avast! Antivirus protection is active.
> http://www.avast.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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


Mime
View raw message