You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ian Vellosa <ve...@btopenworld.com> on 2005/11/21 13:47:40 UTC

[M2] maven-ejb-plugin: build setup help

Hi there!

I’m hoping someone can point me in the right direction here. I have
done all the research that my head can handle and not found a good
example for building the EJB jar file with Maven 2 while using
xdoclet. 

At the moment my pom.xml file has two sections that I think are
relevant. The first takes the java/xdoclet code and generates my
interfaces for me. 

<plugin>
  <artifactId>xdoclet-maven-plugin</artifactId>
  <groupId>org.codehaus.mojo</groupId>
  <version>1.0-alpha-2</version>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>xdoclet</goal>
      </goals>
      <configuration>
        <tasks>
          <ejbdoclet destdir="src/gen/java">
            <deploymentdescriptor destDir="target/classes/META-INF"/>
            <fileset dir="src/main/java" includes="**/*XDoc.java" />
            <homeinterface/>
            <localhomeinterface/>
            <localinterface/>
            <mdb/>
            <remoteinterface/>
            <session/>
            <utilobject cacheHomes="true">
              <packageSubstitution packages="internal.ejb"
substituteWith="util" />
            </utilobject>
            <weblogic 
                version="8.1" 
                createtables="Disabled" 
                validateXML="true" 
                destDir="target/classes/META-INF"/>
          </ejbdoclet>
        </tasks>
      </configuration>
    </execution>
  </executions>
</plugin>

This is working very nicely for me. Then I have a second plug in
which builds the EJBs for me. This is as follows. 

<plugin> 
  <artifactId>maven-ejb-plugin</artifactId> 
  <configuration> 
    <generateClient>true</generateClient> 
    <clientExcludes> 
      <clientExclude>**/internal/**</clientExclude> 
    </clientExcludes> 
  </configuration> 
</plugin>

This is where my problem lies. I build the EJB and EJB client jars,
which I’m very happy about. But there are two things that are wrong. 

Firstly, the generated code that I have is not being compiled into
the project as I would like. I would guess that I need to add it into
the pom.xml file as a resource, so I added this section in the build.

<resource>
  <directory>src/gen/java</directory>
  <excludes>
    <exclude>**/*.java</exclude>
  </excludes>
</resource>

This worked well in that the generated classes showed up in Eclipse.
But the java files were copied into the JAR files. Adding the exclude
stopped this happening. However, with or without the exclude the java
was never compiled. How do I add this? Can I enter another source
directory somehow?


The next problem that I have is that I do not appear to be able to
override the default file excludes. I have put the actual EJB
implementation (along with all the hibernate and other things that a
client does not need to know about) under the package structure
com.myco.proj.internal.xxx. So I would like the client EJB JAR to
exclude anything that contains a ‘internal’ in the package name. I
have seen number of methods mentioned in various email and on the
codehaus website, but none appear to work. Am I missing something? 


I’m sorry for bothering people with this, but I have been looking and
am unable to find an example that I can use which goes beyond the
basic set up of:

<plugin> 

  <artifactId>maven-ejb-plugin</artifactId> 
  <configuration> 
    <generateClient>true</generateClient> 
  </configuration> 

</plugin>

Then most of the documentation relating to the available properties
is for Maven 1. Is there a guide as to how these properties relate to
the M2 builds?

Thanks in advance for any advice
IV




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


Re: [M2] maven-ejb-plugin: build setup help

Posted by Pete <pe...@gmail.com>.
To fix your first problem I believe you need

<ejbdoclet destdir="${project.build.directory}/generated-sources/xdoclet">

and
			<deploymentdescriptor destDir="${project.build.outputDirectory}/META-INF"/>

it seems unless the .java is generated to here it is not picked up -
not sure why though or how to change.

On 21/11/05, Srepfler Srgjan <sr...@lnksystem.com> wrote:
> Yes, the situation is very bad as far as documentation is concerned,
> there's even less documentation on how to generate hibernate artifacts...
>
> Ian Vellosa wrote:
>
> >Hi there!
> >
> >I'm hoping someone can point me in the right direction here. I have
> >done all the research that my head can handle and not found a good
> >example for building the EJB jar file with Maven 2 while using
> >xdoclet.
> >
> >At the moment my pom.xml file has two sections that I think are
> >relevant. The first takes the java/xdoclet code and generates my
> >interfaces for me.
> >
> ><plugin>
> >  <artifactId>xdoclet-maven-plugin</artifactId>
> >  <groupId>org.codehaus.mojo</groupId>
> >  <version>1.0-alpha-2</version>
> >  <executions>
> >    <execution>
> >      <phase>generate-sources</phase>
> >      <goals>
> >        <goal>xdoclet</goal>
> >      </goals>
> >      <configuration>
> >        <tasks>
> >          <ejbdoclet destdir="src/gen/java">
> >            <deploymentdescriptor destDir="target/classes/META-INF"/>
> >            <fileset dir="src/main/java" includes="**/*XDoc.java" />
> >            <homeinterface/>
> >            <localhomeinterface/>
> >            <localinterface/>
> >            <mdb/>
> >            <remoteinterface/>
> >            <session/>
> >            <utilobject cacheHomes="true">
> >              <packageSubstitution packages="internal.ejb"
> >substituteWith="util" />
> >            </utilobject>
> >            <weblogic
> >                version="8.1"
> >                createtables="Disabled"
> >                validateXML="true"
> >                destDir="target/classes/META-INF"/>
> >          </ejbdoclet>
> >        </tasks>
> >      </configuration>
> >    </execution>
> >  </executions>
> ></plugin>
> >
> >This is working very nicely for me. Then I have a second plug in
> >which builds the EJBs for me. This is as follows.
> >
> ><plugin>
> >  <artifactId>maven-ejb-plugin</artifactId>
> >  <configuration>
> >    <generateClient>true</generateClient>
> >    <clientExcludes>
> >      <clientExclude>**/internal/**</clientExclude>
> >    </clientExcludes>
> >  </configuration>
> ></plugin>
> >
> >This is where my problem lies. I build the EJB and EJB client jars,
> >which I'm very happy about. But there are two things that are wrong.
> >
> >Firstly, the generated code that I have is not being compiled into
> >the project as I would like. I would guess that I need to add it into
> >the pom.xml file as a resource, so I added this section in the build.
> >
> ><resource>
> >  <directory>src/gen/java</directory>
> >  <excludes>
> >    <exclude>**/*.java</exclude>
> >  </excludes>
> ></resource>
> >
> >This worked well in that the generated classes showed up in Eclipse.
> >But the java files were copied into the JAR files. Adding the exclude
> >stopped this happening. However, with or without the exclude the java
> >was never compiled. How do I add this? Can I enter another source
> >directory somehow?
> >
> >
> >The next problem that I have is that I do not appear to be able to
> >override the default file excludes. I have put the actual EJB
> >implementation (along with all the hibernate and other things that a
> >client does not need to know about) under the package structure
> >com.myco.proj.internal.xxx. So I would like the client EJB JAR to
> >exclude anything that contains a 'internal' in the package name. I
> >have seen number of methods mentioned in various email and on the
> >codehaus website, but none appear to work. Am I missing something?
> >
> >
> >I'm sorry for bothering people with this, but I have been looking and
> >am unable to find an example that I can use which goes beyond the
> >basic set up of:
> >
> ><plugin>
> >
> >  <artifactId>maven-ejb-plugin</artifactId>
> >  <configuration>
> >    <generateClient>true</generateClient>
> >  </configuration>
> >
> ></plugin>
> >
> >Then most of the documentation relating to the available properties
> >is for Maven 1. Is there a guide as to how these properties relate to
> >the M2 builds?
> >
> >Thanks in advance for any advice
> >IV
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >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: [M2] maven-ejb-plugin: build setup help

Posted by Srepfler Srgjan <sr...@lnksystem.com>.
Yes, the situation is very bad as far as documentation is concerned, 
there's even less documentation on how to generate hibernate artifacts...

Ian Vellosa wrote:

>Hi there!
>
>I’m hoping someone can point me in the right direction here. I have
>done all the research that my head can handle and not found a good
>example for building the EJB jar file with Maven 2 while using
>xdoclet. 
>
>At the moment my pom.xml file has two sections that I think are
>relevant. The first takes the java/xdoclet code and generates my
>interfaces for me. 
>
><plugin>
>  <artifactId>xdoclet-maven-plugin</artifactId>
>  <groupId>org.codehaus.mojo</groupId>
>  <version>1.0-alpha-2</version>
>  <executions>
>    <execution>
>      <phase>generate-sources</phase>
>      <goals>
>        <goal>xdoclet</goal>
>      </goals>
>      <configuration>
>        <tasks>
>          <ejbdoclet destdir="src/gen/java">
>            <deploymentdescriptor destDir="target/classes/META-INF"/>
>            <fileset dir="src/main/java" includes="**/*XDoc.java" />
>            <homeinterface/>
>            <localhomeinterface/>
>            <localinterface/>
>            <mdb/>
>            <remoteinterface/>
>            <session/>
>            <utilobject cacheHomes="true">
>              <packageSubstitution packages="internal.ejb"
>substituteWith="util" />
>            </utilobject>
>            <weblogic 
>                version="8.1" 
>                createtables="Disabled" 
>                validateXML="true" 
>                destDir="target/classes/META-INF"/>
>          </ejbdoclet>
>        </tasks>
>      </configuration>
>    </execution>
>  </executions>
></plugin>
>
>This is working very nicely for me. Then I have a second plug in
>which builds the EJBs for me. This is as follows. 
>
><plugin> 
>  <artifactId>maven-ejb-plugin</artifactId> 
>  <configuration> 
>    <generateClient>true</generateClient> 
>    <clientExcludes> 
>      <clientExclude>**/internal/**</clientExclude> 
>    </clientExcludes> 
>  </configuration> 
></plugin>
>
>This is where my problem lies. I build the EJB and EJB client jars,
>which I’m very happy about. But there are two things that are wrong. 
>
>Firstly, the generated code that I have is not being compiled into
>the project as I would like. I would guess that I need to add it into
>the pom.xml file as a resource, so I added this section in the build.
>
><resource>
>  <directory>src/gen/java</directory>
>  <excludes>
>    <exclude>**/*.java</exclude>
>  </excludes>
></resource>
>
>This worked well in that the generated classes showed up in Eclipse.
>But the java files were copied into the JAR files. Adding the exclude
>stopped this happening. However, with or without the exclude the java
>was never compiled. How do I add this? Can I enter another source
>directory somehow?
>
>
>The next problem that I have is that I do not appear to be able to
>override the default file excludes. I have put the actual EJB
>implementation (along with all the hibernate and other things that a
>client does not need to know about) under the package structure
>com.myco.proj.internal.xxx. So I would like the client EJB JAR to
>exclude anything that contains a ‘internal’ in the package name. I
>have seen number of methods mentioned in various email and on the
>codehaus website, but none appear to work. Am I missing something? 
>
>
>I’m sorry for bothering people with this, but I have been looking and
>am unable to find an example that I can use which goes beyond the
>basic set up of:
>
><plugin> 
>
>  <artifactId>maven-ejb-plugin</artifactId> 
>  <configuration> 
>    <generateClient>true</generateClient> 
>  </configuration> 
>
></plugin>
>
>Then most of the documentation relating to the available properties
>is for Maven 1. Is there a guide as to how these properties relate to
>the M2 builds?
>
>Thanks in advance for any advice
>IV
>
>
>
>
>---------------------------------------------------------------------
>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