You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Piotr Bzdyl <pi...@bzdyl.net> on 2005/09/05 00:32:38 UTC

Demo application based on JBoss DVD trailblaizer

Hello,

I wanted to create template project structure for EJB3 application based 
on the DVD trailblaizer from JBoss site 
(http://trailblazer.demo.jboss.com/DVDTrail/).

I used Maven2 2.0-beta-1-SNAPSHOT -

I created structure which is available at http://piotr.radzisz.com/maven2/

I would like to know your opinions about the structure I created (what I 
did wrong, what should be handled different way etc.). I have following 
problems:

1. There is module demo-par - it is persistence archive file - simple 
jar file but with extension par instead of jar and added persistence.xml 
file in the META-INF directory. I set <packaging> element to par but I 
cannot find where can I find how to bind this packaging type to 
particular plugin (by the way: jar plugin doesn't allow to create jar 
files with extension different than jar - already submitted issue in the 
Maven2 issue tracking system).

2. I found the same problem with the demo-ejb module. Generated artifact 
should have "ejb3" extension(not jar). How should I resolve this?

3. I am not sure if demo-ear module configuration (pom.xml) is correct. 
I defined:
<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
          <modules>
            <javaModule>
              <groupId>net.bzdyl.demo</groupId>
              <artifactId>demo-utils</artifactId>
              <library>true</library>
            </javaModule>
            <ejbModule>
              <groupId>net.bzdyl.demo</groupId>
              <artifactId>demo-par</artifactId>
            </ejbModule>
            <ejbModule>
              <groupId>net.bzdyl.demo</groupId>
              <artifactId>demo-ejb</artifactId>
            </ejbModule>
            <webModule>
              <groupId>net.bzdyl.demo</groupId>
              <artifactId>demo-war</artifactId>
              <contextRoot>/demo</contextRoot>
            </webModule>
          </modules>
        </configuration>
      </plugin>
    </plugins>
  </build>

I guess that when I specify <ejbModule> then ear plugin will look for 
*.jar files (not *.par and *.ejb3 files). How should I handle par and 
ejb3 files in the ear plugin?

I think this kind of the project skeleton could be good start point for 
EJB 3 projects.

Best regards,
Piotrek

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


Re: Demo application based on JBoss DVD trailblaizer

Posted by Edward Yakop <ed...@gmail.com>.
Whoops.
I just realised even if we can create the .par extension,
maven-install-plugin will not take the generate .par file because the
<packaging>jar</packaging>, nor maven-ear-plugin can handle .par file

 java.lang.IllegalStateException: Could not handle artifact type[par]
        at org.apache.maven.plugin.ear.EarModuleFactory.newEarModule(EarModuleFactory.java:61)

I guessed, if approved, in order to tackle this problem properly
maven-install-plugin + maven-ear-plugin needs to be tweaked.

Regards,
Edward Yakop

Note: I just realised that you submit MNG-699 in jira. I apologise to
take initiative to create the JarMojo patch.

On 9/5/05, Edward Yakop <ed...@gmail.com> wrote:
> Have you look at <DependencyManagement> node?
> Look at
> http://jira.codehaus.org/browse/MNG-743 and download the
> sample-m2-project.jar from the attachement.
> 
> I.E.
>    <dependencyManagement>
>       <dependencies>
>          <dependency>
>              <groupId>net.bzdyl.demo</groupId>
>             <artifactId>demo-par</artifactId>
>             <version>1.0</version>
>          </dependency>
>    </dependencyManagement>
> 
> Note: by default maven-jar-plugins hardcoded the .jar file name
> extension. I don't think it's hard to patch the
> maven-components/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java
> file to suport this feature.
> 
> Regards,
> Edward Yakop
> 
> Note:
> The attached file is a sample implementation of JarMojo.
> 
> To use:
> 0. Check out maven-source tree
>     svn co https://svn.apache.org/repos/asf/maven/components/trunk
> maven-components
>     or follow
>     http://maven.apache.org/maven2/developers/building.html
> 
> 1. Update JarMojo.java
> 
>     Replace the JarMojo.java inside
>    maven-components/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar
>    and
>    cd maven-components/maven-plugins/maven-jar-plugin ; m2 install
> 
> 2. Replace pom.xml of demo-par dir.
> 
> <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">
>   <modelVersion>4.0.0</modelVersion>
>   <parent>
>     <groupId>net.bzdyl.demo</groupId>
>     <artifactId>demo</artifactId>
>     <version>1.0-SNAPSHOT</version>
>   </parent>
>   <groupId>net.bzdyl.demo</groupId>
>   <artifactId>demo-par</artifactId>
>   <version>1.0-SNAPSHOT</version>
>   <packaging>jar</packaging>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <finalNameExt>par</finalNameExt> <!-- Notice the ext is par -->
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <dependencies>
>     <dependency>
>       <groupId>javax.persistence</groupId>
>       <artifactId>ejb</artifactId>
>       <version>3.0-public_review</version>
>       <scope>compile</scope>
>     </dependency>
>   </dependencies>
> </project>
> 
> On 9/5/05, Piotr Bzdyl <pi...@bzdyl.net> wrote:
> >
> > >>Additional info: Maven 2 revision I used is: 278636.
> > >>
> > >>And one additional question:
> > >>
> > >>Can I specify version in the parent pom and use inherited value in
> > >>subprojects or I have to specify version separately in every pom.xml?
> > >>
> > >>
> > >
> > >You do not have to specify the version in the pom, it will use the one
> > >stated in the <parent> element.
> > >
> > >
> > What about dependencies in the dependent projects, for example:
> > I specify in the parent pom.xml version 2.1. Then what I should write in
> > the demo-ejb pom.xml in the version attribute:
> > <dependency>
> >       <groupId>net.bzdyl.demo</groupId>
> >       <artifactId>demo-par</artifactId>
> >       <version>????????</version>
> >       <type>par</type>
> >       <scope>compile</scope>
> >     </dependency>
> >
> > I would like to use the same version as the demo-ejb version (without
> > specifing it literally).
> >
> > Best regards,
> > Piotrek
> >
> > ---------------------------------------------------------------------
> > 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: Demo application based on JBoss DVD trailblaizer

Posted by Edward Yakop <ed...@gmail.com>.
Have you look at <DependencyManagement> node?
Look at 
http://jira.codehaus.org/browse/MNG-743 and download the
sample-m2-project.jar from the attachement.

I.E.
   <dependencyManagement>
      <dependencies>
         <dependency>
             <groupId>net.bzdyl.demo</groupId>
            <artifactId>demo-par</artifactId>
            <version>1.0</version>
         </dependency>
   </dependencyManagement>

Note: by default maven-jar-plugins hardcoded the .jar file name
extension. I don't think it's hard to patch the
maven-components/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java
file to suport this feature.

Regards,
Edward Yakop

Note: 
The attached file is a sample implementation of JarMojo.

To use:
0. Check out maven-source tree
    svn co https://svn.apache.org/repos/asf/maven/components/trunk
maven-components
    or follow
    http://maven.apache.org/maven2/developers/building.html

1. Update JarMojo.java

    Replace the JarMojo.java inside 
   maven-components/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar
   and
   cd maven-components/maven-plugins/maven-jar-plugin ; m2 install

2. Replace pom.xml of demo-par dir.

<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>net.bzdyl.demo</groupId>
    <artifactId>demo</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <groupId>net.bzdyl.demo</groupId>
  <artifactId>demo-par</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <finalNameExt>par</finalNameExt> <!-- Notice the ext is par -->
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>javax.persistence</groupId>
      <artifactId>ejb</artifactId>
      <version>3.0-public_review</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>

On 9/5/05, Piotr Bzdyl <pi...@bzdyl.net> wrote:
> 
> >>Additional info: Maven 2 revision I used is: 278636.
> >>
> >>And one additional question:
> >>
> >>Can I specify version in the parent pom and use inherited value in
> >>subprojects or I have to specify version separately in every pom.xml?
> >>
> >>
> >
> >You do not have to specify the version in the pom, it will use the one
> >stated in the <parent> element.
> >
> >
> What about dependencies in the dependent projects, for example:
> I specify in the parent pom.xml version 2.1. Then what I should write in
> the demo-ejb pom.xml in the version attribute:
> <dependency>
>       <groupId>net.bzdyl.demo</groupId>
>       <artifactId>demo-par</artifactId>
>       <version>????????</version>
>       <type>par</type>
>       <scope>compile</scope>
>     </dependency>
> 
> I would like to use the same version as the demo-ejb version (without
> specifing it literally).
> 
> Best regards,
> Piotrek
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

Re: Demo application based on JBoss DVD trailblaizer

Posted by Piotr Bzdyl <pi...@bzdyl.net>.
>>Additional info: Maven 2 revision I used is: 278636.
>>
>>And one additional question:
>>
>>Can I specify version in the parent pom and use inherited value in 
>>subprojects or I have to specify version separately in every pom.xml?
>>    
>>
>
>You do not have to specify the version in the pom, it will use the one
>stated in the <parent> element.
>  
>
What about dependencies in the dependent projects, for example:
I specify in the parent pom.xml version 2.1. Then what I should write in 
the demo-ejb pom.xml in the version attribute:
<dependency>
      <groupId>net.bzdyl.demo</groupId>
      <artifactId>demo-par</artifactId>
      <version>????????</version>
      <type>par</type>
      <scope>compile</scope>
    </dependency>

I would like to use the same version as the demo-ejb version (without 
specifing it literally).

Best regards,
Piotrek

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


Re: Demo application based on JBoss DVD trailblaizer

Posted by Trygve Laugstøl <tr...@codehaus.org>.
On Mon, Sep 05, 2005 at 12:38:08AM +0200, Piotr Bzdyl wrote:
> Additional info: Maven 2 revision I used is: 278636.
> 
> And one additional question:
> 
> Can I specify version in the parent pom and use inherited value in 
> subprojects or I have to specify version separately in every pom.xml?

You do not have to specify the version in the pom, it will use the one
stated in the <parent> element.

--
Trygve

Re: Demo application based on JBoss DVD trailblaizer

Posted by Piotr Bzdyl <pi...@bzdyl.net>.
Additional info: Maven 2 revision I used is: 278636.

And one additional question:

Can I specify version in the parent pom and use inherited value in 
subprojects or I have to specify version separately in every pom.xml?

Best regards,
Piotrek

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