-
1. Re: war module dependence
jaysensharma Oct 14, 2015 8:02 AM (in response to slieer)The last line of your above post does not look right.
If you deploy two war say "App.war" then it can always have a dependency on other deployed JARs or WARs. Those dependencies can be added using "deployment." prefix. (like: deployment.ucenter.war or deployment.util.jar)
So yes, it is possible to have a class loader dependency between deployed applications. Also a deployed JAR or WAR can be having a classloader dependency to some other deployed WAR.
-
2. Re: war module dependence
slieer Oct 14, 2015 11:49 PM (in response to jaysensharma)Have you tested this problem actually ? Using maven project? war dependence war !
jar - Adding WARs to Java's classpath - Stack Overflow
Attached is my example, war dependence war, maven project. Compile not pass.
-
jboss-test.zip 73.3 KB
-
-
3. Re: war module dependence
jaysensharma Oct 15, 2015 12:25 AM (in response to slieer)The attached testcase "jboss-test.zip" is not usable, It has few classes with all Junk characters in it please check:
jboss-test/ejb-in-war-v1/src/main/java/org/jboss/as/quickstarts/ejbinwar_v1/controller/Greeter.java (same with the "ejb-in-war" project)
jboss-test/ejb-in-war-v1/src/main/java/org/jboss/as/quickstarts/ejbinwar_v1/ejb/GreeterEJB.java
-
4. Re: war module dependence
slieer Oct 15, 2015 12:39 AM (in response to jaysensharma)sorry, resend!
-
jboss-test.zip 51.0 KB
-
-
5. Re: war module dependence
slieer Oct 29, 2015 5:57 AM (in response to jaysensharma)Can war module dependence another war module ? Thanks.
-
6. Re: war module dependence
jaysensharma Oct 29, 2015 8:52 AM (in response to slieer)I tried building your project and tested at my end it works.
As mentioned earlier Yes, the classes present inside One WAR deployed on the same JBoss can be seen by another WAR using $WebApp/META-INF//MANIFEST.MF or using "WEB-INF/jboss-deployment-structure.xml"
Dependencies: deployment.jboss-ejb-in-war.war
I am attaching the compiled WAR here to test the same. Looks like your Maven "pom.xml" is not correct as it is not generating the entries properly inside the "jboss-ejb-in-war-v1.war/META-INF/MANIFEST.MF" file.
Just deploy the application on the same JBoss and then access the following URLs and enter name in the text field.
-
jboss-ejb-in-war-v1.war 6.1 KB
-
jboss-ejb-in-war.war 8.5 KB
-
-
7. Re: war module dependence
slieer Dec 28, 2015 6:15 AM (in response to jaysensharma)war dependency war ? maven defaul not support.
'jboss-ejb-in-war-v1.war' does not use Maven Pack?
A jar (Dynamic module) you can rely on a war?
-
8. Re: war module dependence
slieer Feb 16, 2016 5:01 AM (in response to slieer)1 of 1 people found this helpfulwar dependency war ? maven defaul support. Example:
jboss-ejb-in-war.war' pom.xml add:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<attachClasses>true</attachClasses>
</configuration>
</plugin>
可以即生成war and jar包:
jboss-ejb-in-war.war
jboss-ejb-in-war-classes.jar
2、jboss-ejb-in-war-v1.war'
<dependency>
<groupId>com.xxx</groupId>
<artifactId>xxxx</artifactId>
<version>xxxx</version>
<type>jar</type>
<classifier>classes</classifier>
<scope>provided</scope>
</dependency>