You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nidhi Tuli <nt...@paymentone.com> on 2006/03/10 01:26:45 UTC
RE: How do I include my ejb3 and par files in ear for Maven2
My end goal is to generate ear file using Maven2 for
deploying EJB3 in JBoss.
For this purpose I wrote some ejb3 code, which I need to
1. compile
2. generate jar
3. generate ejb3
4. generate par
5. generate ear
and then I will deploy ear. The ear should contain the ejb3 and par
which was generated in previous steps.
I found out after posting this question, that ear plugin supports
copying ejb3 and par files, but they need to be defined in Dependencies.
This is very strange for my situation because, I don't want to load the
ejb3 and par files in my repository so that it could be found when I do
use ear plugin.
Any ideas How can I include the my own generated ejb3 and par files in
my final ear file.
Thanks
Nidhi
-----Original Message-----
From: John Tolentino [mailto:jtolentino@exist.com]
Sent: Thursday, March 09, 2006 4:17 PM
To: Maven Users List
Subject: Re: How do I include my ejb3 and par files in ear.
By the way, please include [m1] or [m2] in your subject for faster
response. Here's the M2 project descriptor for your reference, again,
I'm assuming this is an M2 question:
http://maven.apache.org/maven-model/maven.html
I've just noticed that <type> is not part of the plugin section. It's
not clear what you want to achieve in your POM. Is this part of your
configuration?
Nidhi Tuli wrote:
>EAR plugin only supports " jar, war, ejb, rar, sar" types. If I try to
>include ejb3 and par file for ejb3 deplyment. It throws exception.
>
>Code:
><plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-ear-plugin</artifactId>
> <type>ejb3</type>
> <type>par</type>
> <properties>
> <ear.bundle>true</ear.bundle>
> </properties>
></plugin>
>
>Exception:
> Caused by:
>org.apache.maven.project.InvalidProjectModelException: Parse
error
>reading POM. Reason: Unrecognised tag: 'type' (position:
>START_TAG seen ...</artif
> actId>\n\t\t <type>... @102:11) at
>org.apache.maven.project.DefaultMavenProjectBuilder.readModel(Default
> MavenProjectBuilder.java:1134)at
>org.apache.maven.project.DefaultMavenProjectBuilder.readModel(Default
> MavenProjectBuilder.java:1094)
>
>Any suggestions? Also please provide a sample code for better
>understanding.
>
>/Nidhi
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How do I include my ejb3 and par files in ear for Maven2
Posted by Marco Mistroni <mm...@gmail.com>.
Hello,
here's y pom.xml for creating an ear... give it a try if it helps
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>root</groupId>
<artifactId>project</artifactId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ejb3-deploy</artifactId>
<packaging>ear</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<modules>
<ejbModule>
<groupId>root</groupId>
<artifactId>ejbs</artifactId>
<bundleFileName>
ejb3-app-1.0-SNAPSHOT.par
</bundleFileName>
</ejbModule>
<webModule>
<groupId>root</groupId>
<artifactId>web</artifactId>
<bundleFileName>
ejb3-web.war
</bundleFileName>
</webModule>
<javaModule>
<groupId>root</groupId>
<artifactId>shared</artifactId>
<bundleFileName>sharedlib.jar
</bundleFileName>
</javaModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>root</groupId>
<artifactId>ejbs</artifactId>
<version>1.0</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>root</groupId>
<artifactId>shared</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>root</groupId>
<artifactId>web</artifactId>
<version>1.0</version>
<type>war</type>
</dependency>
</dependencies>
</project>
Re: How do I include my ejb3 and par files in ear for Maven2
Posted by Stephane Nicoll <st...@gmail.com>.
show your maven projects structure please.
s/
On 3/10/06, Nidhi Tuli <nt...@paymentone.com> wrote:
> My end goal is to generate ear file using Maven2 for
> deploying EJB3 in JBoss.
>
>
> For this purpose I wrote some ejb3 code, which I need to
> 1. compile
> 2. generate jar
> 3. generate ejb3
> 4. generate par
> 5. generate ear
>
> and then I will deploy ear. The ear should contain the ejb3 and par
> which was generated in previous steps.
>
> I found out after posting this question, that ear plugin supports
> copying ejb3 and par files, but they need to be defined in Dependencies.
>
> This is very strange for my situation because, I don't want to load the
> ejb3 and par files in my repository so that it could be found when I do
> use ear plugin.
>
> Any ideas How can I include the my own generated ejb3 and par files in
> my final ear file.
>
> Thanks
> Nidhi
>
> -----Original Message-----
> From: John Tolentino [mailto:jtolentino@exist.com]
> Sent: Thursday, March 09, 2006 4:17 PM
> To: Maven Users List
> Subject: Re: How do I include my ejb3 and par files in ear.
>
> By the way, please include [m1] or [m2] in your subject for faster
> response. Here's the M2 project descriptor for your reference, again,
> I'm assuming this is an M2 question:
> http://maven.apache.org/maven-model/maven.html
>
> I've just noticed that <type> is not part of the plugin section. It's
> not clear what you want to achieve in your POM. Is this part of your
> configuration?
>
> Nidhi Tuli wrote:
>
> >EAR plugin only supports " jar, war, ejb, rar, sar" types. If I try to
> >include ejb3 and par file for ejb3 deplyment. It throws exception.
> >
> >Code:
> ><plugin>
> > <groupId>org.apache.maven.plugins</groupId>
> > <artifactId>maven-ear-plugin</artifactId>
> > <type>ejb3</type>
> > <type>par</type>
> > <properties>
> > <ear.bundle>true</ear.bundle>
> > </properties>
> ></plugin>
> >
> >Exception:
> > Caused by:
> >org.apache.maven.project.InvalidProjectModelException: Parse
> error
> >reading POM. Reason: Unrecognised tag: 'type' (position:
> >START_TAG seen ...</artif
> > actId>\n\t\t <type>... @102:11) at
> >org.apache.maven.project.DefaultMavenProjectBuilder.readModel(Default
> > MavenProjectBuilder.java:1134)at
> >org.apache.maven.project.DefaultMavenProjectBuilder.readModel(Default
> > MavenProjectBuilder.java:1094)
> >
> >Any suggestions? Also please provide a sample code for better
> >understanding.
> >
> >/Nidhi
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
.::You're welcome ::.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How do I include my ejb3 and par files in ear for Maven2
Posted by John Tolentino <jt...@exist.com>.
Try out first the suggested solution that you mentioned (adding the ejb3
and par files into your dependencies) then extract the ear file. You are
most likely to see that those dependencies are already packaged in the
ear. Maven 2 will exclude your dependency from the package only if you
defined a scope that tells it to do so (e.g. provided) or added it to
your exclusion list.
- John
Nidhi Tuli wrote:
>My end goal is to generate ear file using Maven2 for
>deploying EJB3 in JBoss.
>
>
>For this purpose I wrote some ejb3 code, which I need to
>1. compile
>2. generate jar
>3. generate ejb3
>4. generate par
>5. generate ear
>
>and then I will deploy ear. The ear should contain the ejb3 and par
>which was generated in previous steps.
>
>I found out after posting this question, that ear plugin supports
>copying ejb3 and par files, but they need to be defined in Dependencies.
>
>This is very strange for my situation because, I don't want to load the
>ejb3 and par files in my repository so that it could be found when I do
>use ear plugin.
>
>Any ideas How can I include the my own generated ejb3 and par files in
>my final ear file.
>
>Thanks
>Nidhi
>
>-----Original Message-----
>From: John Tolentino [mailto:jtolentino@exist.com]
>Sent: Thursday, March 09, 2006 4:17 PM
>To: Maven Users List
>Subject: Re: How do I include my ejb3 and par files in ear.
>
>By the way, please include [m1] or [m2] in your subject for faster
>response. Here's the M2 project descriptor for your reference, again,
>I'm assuming this is an M2 question:
>http://maven.apache.org/maven-model/maven.html
>
>I've just noticed that <type> is not part of the plugin section. It's
>not clear what you want to achieve in your POM. Is this part of your
>configuration?
>
>Nidhi Tuli wrote:
>
>
>
>>EAR plugin only supports " jar, war, ejb, rar, sar" types. If I try to
>>include ejb3 and par file for ejb3 deplyment. It throws exception.
>>
>>Code:
>><plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-ear-plugin</artifactId>
>> <type>ejb3</type>
>> <type>par</type>
>> <properties>
>> <ear.bundle>true</ear.bundle>
>> </properties>
>></plugin>
>>
>>Exception:
>> Caused by:
>>org.apache.maven.project.InvalidProjectModelException: Parse
>>
>>
>error
>
>
>>reading POM. Reason: Unrecognised tag: 'type' (position:
>>START_TAG seen ...</artif
>> actId>\n\t\t <type>... @102:11) at
>>org.apache.maven.project.DefaultMavenProjectBuilder.readModel(Default
>> MavenProjectBuilder.java:1134)at
>>org.apache.maven.project.DefaultMavenProjectBuilder.readModel(Default
>> MavenProjectBuilder.java:1094)
>>
>>Any suggestions? Also please provide a sample code for better
>>understanding.
>>
>>/Nidhi
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org