You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ja...@external.t-mobile.at on 2008/06/10 18:40:34 UTC

Antwort: Upgrading from WAR to EAR-based CXF service using Maven [Virus checked]

Hi Glen,

i'm using this pom.xml for EAR project (i replaced artifacts by "blabla" 
but it should be useful)

best regards
jano

<project>
        <parent>
                blabla
        </parent>

        <modelVersion>4.0.0</modelVersion>
        <artifactId>myEAR</artifactId>
        <groupId>xx</groupId>
        <version>${blabla.version}</version>
        <packaging>ear</packaging>

        <dependencies>
 
                <dependency>
                        <artifactId>Asynchronous-utils-MDB</artifactId>
                        <groupId>blabla</groupId>
                        <version>${blabla.version}</version>
                        <type>ejb</type>
                </dependency>

                <dependency>
                        <artifactId>blabla-web</artifactId>
                        <groupId>blabla</groupId>
                        <version>${blabla.version}</version>
                        <type>war</type>
                </dependency>

                <dependency>
                        <artifactId>blabla-components</artifactId>
                        <groupId>blabla</groupId>
                        <version>${blabla.version}</version>
                </dependency>
 
        </dependencies>


        <build>
                <plugins>
                        <plugin>
 <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-ear-plugin</artifactId>
                                <configuration>
                                        <version>1.4</version>
                                        <modules>

                                                <ejbModule>
 <artifactId>Asynchronous-utils-MDB</artifactId>
 <groupId>blabla</groupId>
                                                </ejbModule>
 
                                                <webModule>
 <groupId>blabla</groupId>
 <artifactId>blabla-web</artifactId>
 <contextRoot>/blabla-${blabla.release}</contextRoot>
                                                </webModule>
 
                                                <javaModule>
 <groupId>blabla</groupId>
 <artifactId>blabla-components</artifactId>
 <includeInApplicationXml>true</includeInApplicationXml>
                                                </javaModule>
                                        </modules>

                                        <jboss>
                                                <version>4</version>
                                        </jboss>
                                </configuration>
                        </plugin>
                </plugins>
        </build>


</project>





Glen Mazza <gl...@gmail.com> 
06/10/2008 18:30
Bitte antworten an
users@cxf.apache.org


An
users@cxf.apache.org
Kopie

Thema
Upgrading from WAR to EAR-based CXF service using Maven  [Virus checked]







Hello,

Up until now I've been using Maven-generated WAR files to deploy CXF-based
web service providers to Tomcat, as shown in my wsdl-first tutorial[1]. 
For
deployment to WebLogic, however, due to different JARs needing to be
used[2], I will need to upgrade to an EAR instead.  I would like to 
continue
using Maven for this (I guess using the maven-ear-plugin)--does anyone 
know
of an online sample that can show me how to do this?  If not, I can 
probably
figure this out on my own.

Thanks,
Glen

[1] http://www.jroller.com/gmazza/date/20080417#WFstep3
[2]
http://cwiki.apache.org/CXF20DOC/appserverguide.html#AppServerGuide-WebLogic


-- 
View this message in context: 
http://www.nabble.com/Upgrading-from-WAR-to-EAR-based-CXF-service-using-Maven-tp17759554p17759554.html

Sent from the cxf-user mailing list archive at Nabble.com.





Antwort: Re: Antwort: Upgrading from WAR to EAR-based CXF service using Maven [Virus checked]

Posted by ja...@external.t-mobile.at.
Hi Glen,

1) 
in my case (maven2.0.8) i have no dependencies in WAR project, but instead 
its parent project has lots of dependencies. Final war file is without 
libraries in my case.
I don't use any special configuration for WAR, I only used 
<packaging>war</packaging>   (I don't configure maven-war-plugin plugin).

2) 
i decided to have nearly nothing in WAR .. i mean no common libraries and 
application logic (which maybe will be used later by EJBs and I'll need to 
move it from WAR to EAR).
In my case it was simple to accomplish this, because i dont have any 
classes in WAR project, which are really required for builing project. And 
in runtime required librarties are loaded from EAR.

That's why I used following structures:
EAR project - contains components jar, ejbs jar and war file. (my sample 
pom.xml)
components project - this is simple JAR with nothing except dependencies 
to all other jars. (created because each dependecny in EAR has to be 
listed there twice. This way it's not required, because transitive 
dependencies are resolved automatically).
WAR project - has no dependencies at all.

This way there is physically no jar in WAR, but in runtime content of all 
jars is available in the same classloader.

best regards
jano




Glen Mazza <gl...@gmail.com> 
06/10/2008 20:15
Bitte antworten an
users@cxf.apache.org


An
users@cxf.apache.org
Kopie

Thema
Re: Antwort: Upgrading from WAR to EAR-based CXF service using Maven 
[Virus checked]







Thanks, Jano, that helped a lot.  Since I'm using WebLogic and not JBoss I
had the weblogic-application.xml file get automatically included in the 
EAR
by placing it in {ear module}\src\main\application\META-INF folder.

Next issue, if anyone knows:  I'm getting the JARs duplicated in both the
EAR and the WAR (within the WEB-INF/lib)--is there a way I can keep them
just in the latter?  According to [3], "...Maven assumes fat WARs [i.e.,
those with JARs in the WEB-INF/lib folder] and does not include transitive
dependencies of WARs within the EAR."  But for me, they *are* getting in 
the
EAR directory as well as within the included WAR file.  This is the only
dependency I'm listing for the EAR, namely, the WAR:

                 <dependencies>
                                 <dependency>
 <groupId>com.mycompany.webservice</groupId>
 <artifactId>service</artifactId>
                                     <version>1.0-SNAPSHOT</version>
                                                 <type>war</type>
                                 </dependency>
                 </dependencies>

Thanks,
Glen

[3]
http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html


jan.minaroviech wrote:
> 
> Hi Glen,
> 
> i'm using this pom.xml for EAR project (i replaced artifacts by "blabla" 

> but it should be useful)
> 
> best regards
> jano
> 
> <project>
>         <parent>
>                 blabla
>         </parent>
> 
>         <modelVersion>4.0.0</modelVersion>
>         <artifactId>myEAR</artifactId>
>         <groupId>xx</groupId>
>         <version>${blabla.version}</version>
>         <packaging>ear</packaging>
> 
>         <dependencies>
> 
>                 <dependency>
>                         <artifactId>Asynchronous-utils-MDB</artifactId>
>                         <groupId>blabla</groupId>
>                         <version>${blabla.version}</version>
>                         <type>ejb</type>
>                 </dependency>
> 
>                 <dependency>
>                         <artifactId>blabla-web</artifactId>
>                         <groupId>blabla</groupId>
>                         <version>${blabla.version}</version>
>                         <type>war</type>
>                 </dependency>
> 
>                 <dependency>
>                         <artifactId>blabla-components</artifactId>
>                         <groupId>blabla</groupId>
>                         <version>${blabla.version}</version>
>                 </dependency>
> 
>         </dependencies>
> 
> 
>         <build>
>                 <plugins>
>                         <plugin>
>  <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-ear-plugin</artifactId>
>                                 <configuration>
>                                         <version>1.4</version>
>                                         <modules>
> 
>                                                 <ejbModule>
>  <artifactId>Asynchronous-utils-MDB</artifactId>
>  <groupId>blabla</groupId>
>                                                 </ejbModule>
> 
>                                                 <webModule>
>  <groupId>blabla</groupId>
>  <artifactId>blabla-web</artifactId>
>  <contextRoot>/blabla-${blabla.release}</contextRoot>
>                                                 </webModule>
> 
>                                                 <javaModule>
>  <groupId>blabla</groupId>
>  <artifactId>blabla-components</artifactId>
>  <includeInApplicationXml>true</includeInApplicationXml>
>                                                 </javaModule>
>                                         </modules>
> 
>                                         <jboss>
>                                                 <version>4</version>
>                                         </jboss>
>                                 </configuration>
>                         </plugin>
>                 </plugins>
>         </build>
> 
> 
> </project>
> 
> 
> 
> 
> 
> Glen Mazza <gl...@gmail.com> 
> 06/10/2008 18:30
> Bitte antworten an
> users@cxf.apache.org
> 
> 
> An
> users@cxf.apache.org
> Kopie
> 
> Thema
> Upgrading from WAR to EAR-based CXF service using Maven  [Virus checked]
> 
> 
> 
> 
> 
> 
> 
> Hello,
> 
> Up until now I've been using Maven-generated WAR files to deploy 
CXF-based
> web service providers to Tomcat, as shown in my wsdl-first tutorial[1]. 
> For
> deployment to WebLogic, however, due to different JARs needing to be
> used[2], I will need to upgrade to an EAR instead.  I would like to 
> continue
> using Maven for this (I guess using the maven-ear-plugin)--does anyone 
> know
> of an online sample that can show me how to do this?  If not, I can 
> probably
> figure this out on my own.
> 
> Thanks,
> Glen
> 
> [1] http://www.jroller.com/gmazza/date/20080417#WFstep3
> [2]
> 
http://cwiki.apache.org/CXF20DOC/appserverguide.html#AppServerGuide-WebLogic

> 
> 
> -- 
> View this message in context: 
> 
http://www.nabble.com/Upgrading-from-WAR-to-EAR-based-CXF-service-using-Maven-tp17759554p17759554.html

> 
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Upgrading-from-WAR-to-EAR-based-CXF-service-using-Maven-tp17759554p17761537.html

Sent from the cxf-user mailing list archive at Nabble.com.





Re: Antwort: Upgrading from WAR to EAR-based CXF service using Maven [Virus checked]

Posted by Glen Mazza <gl...@gmail.com>.
Thanks, Jano, that helped a lot.  Since I'm using WebLogic and not JBoss I
had the weblogic-application.xml file get automatically included in the EAR
by placing it in {ear module}\src\main\application\META-INF folder.

Next issue, if anyone knows:  I'm getting the JARs duplicated in both the
EAR and the WAR (within the WEB-INF/lib)--is there a way I can keep them
just in the latter?  According to [3], "...Maven assumes fat WARs [i.e.,
those with JARs in the WEB-INF/lib folder] and does not include transitive
dependencies of WARs within the EAR."  But for me, they *are* getting in the
EAR directory as well as within the included WAR file.  This is the only
dependency I'm listing for the EAR, namely, the WAR:

	<dependencies>
		<dependency>
			<groupId>com.mycompany.webservice</groupId>
			<artifactId>service</artifactId>
 		    <version>1.0-SNAPSHOT</version>
			<type>war</type>
		</dependency>
	</dependencies>

Thanks,
Glen

[3]
http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html


jan.minaroviech wrote:
> 
> Hi Glen,
> 
> i'm using this pom.xml for EAR project (i replaced artifacts by "blabla" 
> but it should be useful)
> 
> best regards
> jano
> 
> <project>
>         <parent>
>                 blabla
>         </parent>
> 
>         <modelVersion>4.0.0</modelVersion>
>         <artifactId>myEAR</artifactId>
>         <groupId>xx</groupId>
>         <version>${blabla.version}</version>
>         <packaging>ear</packaging>
> 
>         <dependencies>
>  
>                 <dependency>
>                         <artifactId>Asynchronous-utils-MDB</artifactId>
>                         <groupId>blabla</groupId>
>                         <version>${blabla.version}</version>
>                         <type>ejb</type>
>                 </dependency>
> 
>                 <dependency>
>                         <artifactId>blabla-web</artifactId>
>                         <groupId>blabla</groupId>
>                         <version>${blabla.version}</version>
>                         <type>war</type>
>                 </dependency>
> 
>                 <dependency>
>                         <artifactId>blabla-components</artifactId>
>                         <groupId>blabla</groupId>
>                         <version>${blabla.version}</version>
>                 </dependency>
>  
>         </dependencies>
> 
> 
>         <build>
>                 <plugins>
>                         <plugin>
>  <groupId>org.apache.maven.plugins</groupId>
>                                 <artifactId>maven-ear-plugin</artifactId>
>                                 <configuration>
>                                         <version>1.4</version>
>                                         <modules>
> 
>                                                 <ejbModule>
>  <artifactId>Asynchronous-utils-MDB</artifactId>
>  <groupId>blabla</groupId>
>                                                 </ejbModule>
>  
>                                                 <webModule>
>  <groupId>blabla</groupId>
>  <artifactId>blabla-web</artifactId>
>  <contextRoot>/blabla-${blabla.release}</contextRoot>
>                                                 </webModule>
>  
>                                                 <javaModule>
>  <groupId>blabla</groupId>
>  <artifactId>blabla-components</artifactId>
>  <includeInApplicationXml>true</includeInApplicationXml>
>                                                 </javaModule>
>                                         </modules>
> 
>                                         <jboss>
>                                                 <version>4</version>
>                                         </jboss>
>                                 </configuration>
>                         </plugin>
>                 </plugins>
>         </build>
> 
> 
> </project>
> 
> 
> 
> 
> 
> Glen Mazza <gl...@gmail.com> 
> 06/10/2008 18:30
> Bitte antworten an
> users@cxf.apache.org
> 
> 
> An
> users@cxf.apache.org
> Kopie
> 
> Thema
> Upgrading from WAR to EAR-based CXF service using Maven  [Virus checked]
> 
> 
> 
> 
> 
> 
> 
> Hello,
> 
> Up until now I've been using Maven-generated WAR files to deploy CXF-based
> web service providers to Tomcat, as shown in my wsdl-first tutorial[1]. 
> For
> deployment to WebLogic, however, due to different JARs needing to be
> used[2], I will need to upgrade to an EAR instead.  I would like to 
> continue
> using Maven for this (I guess using the maven-ear-plugin)--does anyone 
> know
> of an online sample that can show me how to do this?  If not, I can 
> probably
> figure this out on my own.
> 
> Thanks,
> Glen
> 
> [1] http://www.jroller.com/gmazza/date/20080417#WFstep3
> [2]
> http://cwiki.apache.org/CXF20DOC/appserverguide.html#AppServerGuide-WebLogic
> 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Upgrading-from-WAR-to-EAR-based-CXF-service-using-Maven-tp17759554p17759554.html
> 
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Upgrading-from-WAR-to-EAR-based-CXF-service-using-Maven-tp17759554p17761537.html
Sent from the cxf-user mailing list archive at Nabble.com.