You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Markus KARG <ma...@gmx.net> on 2006/09/06 19:27:29 UTC

How to build JEE 5 EJB-JARs?

Hi,

I'm new to maven and have some problems, I hope you can help me.

I have migrated my J2EE 1.4 application to JEE 5.
Now I need to migrate my mvn2 pom.xml file.

So I changed the following:

1) Switched compiler from default Java 1.3 to Java 5

  <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.5</source>
                <target>1.5</target>
            </configuration>
        </plugin>
    </plugins>
  </build>

This seems to work well.

2) Switched ejb packaging

According to "BetterBuildsWithMaven.pdf" I switched from
<packaging>ejb</packaging> to <packaging>ejb3</packaging>. Unfortunately
this didn't work, since it didn't find any ejb3. So I switched back to
<packaging>ejb</packaging> in the hope that EJB3 support is already
included. Is it? Or what to do to get EJB 3 packaging?

3) Switched JEE JARs

According to "BetterBuildsWithMaven.pdf" I formerly used

<dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-j2ee_1.4_spec</artifactId>
      <version>1.0</version>
      <scope>provided</scope>
</dependency>

But now I need JEE 5. It seems there is no Geronimo 1.5 spec, so what to
do now?

Would be great if you could help me!

Thanks a lot!
Markus

Re: How to build JEE 5 EJB-JARs?

Posted by Markus KARG <ma...@gmx.net>.
Alexander Sack wrote:
> Yea, I don't like having ejb-jar.xml either and I use JBoss which has its
> own quirks regarding Class-Path.
>
> To answer your question, EJB3 is conceptually SUPPOSE to be simpler and
> essentially a special JAR file with annotationed classes.  What do you
> envision the EJB3 plugin to do for you exactly?  I'm building EJB3's with
> Maven2 using the jar plugin.  Works great minus the fact that I need
> to hand
> edit a Class-Path entry within my EJB3 jar under JBoss since it doesn't
> support the Java EE 5 lib directory feature (Glassfish obviously does).
Well, I am not an EJB3 expert, so actually I do not know what EJB 3.0
spec mandates the packaging to be. So is there really no difference to a
simple JAR? For what is that planned ejb3 plugin good then?
>
> -aps
>
> On 9/7/06, Markus KARG <ma...@gmx.net> wrote:
>>
>> Actually I didn't want to have a ejb-jar.xml any longer with EJB3.
>> What about the status of that ejb3 plugin: When will it be finished?
>> I mean, this is a thing I expect Maven to do for me.
>>
>> Takashi Nishigaya wrote:
>> > The maven-ear-plugin does not recognized the jar project as ejb3
>> module.
>> > If you plan to create ear application with ejb3 modules, the ejb3
>> > project should declare <packaging>ejb</packaging> in the pom.xml, and
>> > prepare the empty ejb-jar.xml declaring ejb3 schema namespace.
>> >
>> > src/main/resources/META-INF/ejb-jar.xml:
>> >
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <ejb-jar
>> >   xmlns = "http://java.sun.com/xml/ns/javaee"
>> >   xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
>> >   xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee
>> >     http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
>> >   version = "3.0">
>> > </ejb-jar>
>> >
>> > This will work well with glassfish.
>> >
>> > Thanks,
>> > Takashi Nishigaya
>> >
>> > Alexander Sack wrote:
>> >> I use packaging type "JAR" for all EJB3 builds as its just easier
>> then
>> >> trying to retrofit the current ejb plugin.
>> >>
>> >> -aps
>> >>
>> >> On 9/6/06, Alexandre Russel <al...@russel.fr> wrote:
>> >>
>> >>>
>> >>>
>> >>> > According to "BetterBuildsWithMaven.pdf" I switched from
>> >>> > <packaging>ejb</packaging> to <packaging>ejb3</packaging>.
>> >>> Unfortunately
>> >>> change it to jar.
>> >>> Alex
>> >>>
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
>>
>>
>>
>>
>
>


Re: How to build JEE 5 EJB-JARs?

Posted by Alexander Sack <pi...@gmail.com>.
Yea, I don't like having ejb-jar.xml either and I use JBoss which has its
own quirks regarding Class-Path.

To answer your question, EJB3 is conceptually SUPPOSE to be simpler and
essentially a special JAR file with annotationed classes.  What do you
envision the EJB3 plugin to do for you exactly?  I'm building EJB3's with
Maven2 using the jar plugin.  Works great minus the fact that I need to hand
edit a Class-Path entry within my EJB3 jar under JBoss since it doesn't
support the Java EE 5 lib directory feature (Glassfish obviously does).

-aps

On 9/7/06, Markus KARG <ma...@gmx.net> wrote:
>
> Actually I didn't want to have a ejb-jar.xml any longer with EJB3.
> What about the status of that ejb3 plugin: When will it be finished?
> I mean, this is a thing I expect Maven to do for me.
>
> Takashi Nishigaya wrote:
> > The maven-ear-plugin does not recognized the jar project as ejb3 module.
> > If you plan to create ear application with ejb3 modules, the ejb3
> > project should declare <packaging>ejb</packaging> in the pom.xml, and
> > prepare the empty ejb-jar.xml declaring ejb3 schema namespace.
> >
> > src/main/resources/META-INF/ejb-jar.xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <ejb-jar
> >   xmlns = "http://java.sun.com/xml/ns/javaee"
> >   xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
> >   xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee
> >     http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
> >   version = "3.0">
> > </ejb-jar>
> >
> > This will work well with glassfish.
> >
> > Thanks,
> > Takashi Nishigaya
> >
> > Alexander Sack wrote:
> >> I use packaging type "JAR" for all EJB3 builds as its just easier then
> >> trying to retrofit the current ejb plugin.
> >>
> >> -aps
> >>
> >> On 9/6/06, Alexandre Russel <al...@russel.fr> wrote:
> >>
> >>>
> >>>
> >>> > According to "BetterBuildsWithMaven.pdf" I switched from
> >>> > <packaging>ejb</packaging> to <packaging>ejb3</packaging>.
> >>> Unfortunately
> >>> change it to jar.
> >>> Alex
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
>
>


-- 
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson

Re: How to build JEE 5 EJB-JARs?

Posted by Markus KARG <ma...@gmx.net>.
Actually I didn't want to have a ejb-jar.xml any longer with EJB3.
What about the status of that ejb3 plugin: When will it be finished?
I mean, this is a thing I expect Maven to do for me.

Takashi Nishigaya wrote:
> The maven-ear-plugin does not recognized the jar project as ejb3 module.
> If you plan to create ear application with ejb3 modules, the ejb3
> project should declare <packaging>ejb</packaging> in the pom.xml, and
> prepare the empty ejb-jar.xml declaring ejb3 schema namespace.
>
> src/main/resources/META-INF/ejb-jar.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ejb-jar
>   xmlns = "http://java.sun.com/xml/ns/javaee"
>   xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee
>     http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
>   version = "3.0">
> </ejb-jar>
>
> This will work well with glassfish.
>
> Thanks,
> Takashi Nishigaya
>
> Alexander Sack wrote:
>> I use packaging type "JAR" for all EJB3 builds as its just easier then
>> trying to retrofit the current ejb plugin.
>>
>> -aps
>>
>> On 9/6/06, Alexandre Russel <al...@russel.fr> wrote:
>>
>>>
>>>
>>> > According to "BetterBuildsWithMaven.pdf" I switched from
>>> > <packaging>ejb</packaging> to <packaging>ejb3</packaging>.
>>> Unfortunately
>>> change it to jar.
>>> Alex
>>>
>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


Re: How to build JEE 5 EJB-JARs?

Posted by Takashi Nishigaya <Ta...@Sun.COM>.
The maven-ear-plugin does not recognized the jar project as ejb3 module.
If you plan to create ear application with ejb3 modules, the ejb3 
project should declare <packaging>ejb</packaging> in the pom.xml, and 
prepare the empty ejb-jar.xml declaring ejb3 schema namespace.

src/main/resources/META-INF/ejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar
   xmlns = "http://java.sun.com/xml/ns/javaee"
   xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee
     http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
   version = "3.0">
</ejb-jar>

This will work well with glassfish.

Thanks,
Takashi Nishigaya

Alexander Sack wrote:
> I use packaging type "JAR" for all EJB3 builds as its just easier then
> trying to retrofit the current ejb plugin.
> 
> -aps
> 
> On 9/6/06, Alexandre Russel <al...@russel.fr> wrote:
> 
>>
>>
>> > According to "BetterBuildsWithMaven.pdf" I switched from
>> > <packaging>ejb</packaging> to <packaging>ejb3</packaging>. 
>> Unfortunately
>> change it to jar.
>> Alex
>>
>>
>>
> 
> 


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


Re: How to build JEE 5 EJB-JARs?

Posted by Alexander Sack <pi...@gmail.com>.
I use packaging type "JAR" for all EJB3 builds as its just easier then
trying to retrofit the current ejb plugin.

-aps

On 9/6/06, Alexandre Russel <al...@russel.fr> wrote:
>
>
> > According to "BetterBuildsWithMaven.pdf" I switched from
> > <packaging>ejb</packaging> to <packaging>ejb3</packaging>. Unfortunately
> change it to jar.
> Alex
>
>
>


-- 
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson

Re: How to build JEE 5 EJB-JARs?

Posted by Markus KARG <ma...@gmx.net>.
Yes certainly you are right the ejb.jar is nothing else than a normal
.jar, but I expected the ejb3 task to optionally produce the
ejb-client.jar, containing of the the interfaces and its dependencies,
plus creating the Class-Path: entry to the ejb-client.jar in the
ejb.jar. So I have to do all that manuall now? This is taken away the
magic I hoped maven2 would bring to my builds... :-(

Markus

Alexander Sack wrote:
> Well Maven doc isn't exactly great since its not really centralized.
>
> But as many have stated custom packaging part of the EJB3 spec never
> made it
> and as such, the JAR plugin is your best bet!  :D
>
> -aps
>
> On 9/8/06, Markus KARG <ma...@gmx.net> wrote:
>>
>> Alexandre Russel wrote:
>> >>>> According to "BetterBuildsWithMaven.pdf" I switched from
>> >>>> <packaging>ejb</packaging> to <packaging>ejb3</packaging>.
>> Unfortunately
>> >>>>
>> >>> change it to jar.
>> >>> Alex
>> >>>
>> >> You mean there is no difference between ejb3 and jar? For what is
>> ejb3
>> >> good then?
>> >>
>> > no, I mean the packaging is the same. It is just a jar with a
>> persistence.xml
>> > file. the Ejb3 extension/packaging comes from an early draft of the
>> spec.
>> > That didn't make to the final draft.
>> > The packaging and what ejb3 are good for are unrelated :-)
>> > alex
>> >
>>
>> So there actually is no more ejb3 plugin but users shall use jar? Cool.
>> Would be great if this would be found in the description of the ejb
>> plugin on the web (or in the "BetterBuildsWithMaven.pdf") so people do
>> not spend days with boring questions like mine. ;-)
>>
>>
>>
>
>


Re: How to build JEE 5 EJB-JARs?

Posted by Alexander Sack <pi...@gmail.com>.
Well Maven doc isn't exactly great since its not really centralized.

But as many have stated custom packaging part of the EJB3 spec never made it
and as such, the JAR plugin is your best bet!  :D

-aps

On 9/8/06, Markus KARG <ma...@gmx.net> wrote:
>
> Alexandre Russel wrote:
> >>>> According to "BetterBuildsWithMaven.pdf" I switched from
> >>>> <packaging>ejb</packaging> to <packaging>ejb3</packaging>.
> Unfortunately
> >>>>
> >>> change it to jar.
> >>> Alex
> >>>
> >> You mean there is no difference between ejb3 and jar? For what is ejb3
> >> good then?
> >>
> > no, I mean the packaging is the same. It is just a jar with a
> persistence.xml
> > file. the Ejb3 extension/packaging comes from an early draft of the
> spec.
> > That didn't make to the final draft.
> > The packaging and what ejb3 are good for are unrelated :-)
> > alex
> >
>
> So there actually is no more ejb3 plugin but users shall use jar? Cool.
> Would be great if this would be found in the description of the ejb
> plugin on the web (or in the "BetterBuildsWithMaven.pdf") so people do
> not spend days with boring questions like mine. ;-)
>
>
>


-- 
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson

Re: How to build JEE 5 EJB-JARs?

Posted by Markus KARG <ma...@gmx.net>.
Alexandre Russel wrote:
>>>> According to "BetterBuildsWithMaven.pdf" I switched from
>>>> <packaging>ejb</packaging> to <packaging>ejb3</packaging>. Unfortunately
>>>>         
>>> change it to jar.
>>> Alex
>>>       
>> You mean there is no difference between ejb3 and jar? For what is ejb3
>> good then?
>>     
> no, I mean the packaging is the same. It is just a jar with a persistence.xml 
> file. the Ejb3 extension/packaging comes from an early draft of the spec. 
> That didn't make to the final draft.
> The packaging and what ejb3 are good for are unrelated :-)
> alex
>   

So there actually is no more ejb3 plugin but users shall use jar? Cool.
Would be great if this would be found in the description of the ejb
plugin on the web (or in the "BetterBuildsWithMaven.pdf") so people do
not spend days with boring questions like mine. ;-)

Re: How to build JEE 5 EJB-JARs?

Posted by Alexandre Russel <al...@russel.fr>.
> >> According to "BetterBuildsWithMaven.pdf" I switched from
> >> <packaging>ejb</packaging> to <packaging>ejb3</packaging>. Unfortunately
> >
> > change it to jar.
> > Alex
>
> You mean there is no difference between ejb3 and jar? For what is ejb3
> good then?
no, I mean the packaging is the same. It is just a jar with a persistence.xml 
file. the Ejb3 extension/packaging comes from an early draft of the spec. 
That didn't make to the final draft.
The packaging and what ejb3 are good for are unrelated :-)
alex

Re: How to build JEE 5 EJB-JARs?

Posted by Markus KARG <ma...@gmx.net>.
Alexandre Russel wrote:
>> According to "BetterBuildsWithMaven.pdf" I switched from
>> <packaging>ejb</packaging> to <packaging>ejb3</packaging>. Unfortunately
>>     
> change it to jar.
> Alex
>   
You mean there is no difference between ejb3 and jar? For what is ejb3
good then?

Markus

Re: How to build JEE 5 EJB-JARs?

Posted by Alexandre Russel <al...@russel.fr>.
> According to "BetterBuildsWithMaven.pdf" I switched from
> <packaging>ejb</packaging> to <packaging>ejb3</packaging>. Unfortunately
change it to jar.
Alex