You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Baskar D <db...@corelogic.com> on 2012/07/10 07:55:40 UTC

Xdoclet not generating EJB's

Hi,

I am using xdoclet maven plug-in for generating EJB's. I configured xdoclet
properly and able to generate EJB when I build the project through Netbeans
IDE and command propmpt.

In Netbeans simple I can right click on project and select Clean and Build.
In command prompt, I use the command mvn clean install.

Build successful in both the ways. However, my requirement want to build the
project through Java API.

I tried to build the project like below ,

Process pb = new ProcessBuilder("cmd.exe", "/C", getMavenHome() +
"\\bin\\mvn.bat -f " + getProjectPath() + " -DskipTests=true clean
install");

and also like below 

process = Runtime.getRuntime().exec(getMavenHome() + "\\bin\\mvn.bat -f " +
getProjectPath() + " -DskipTests=true clean install");


Through the above commands I can able build the project successfully if the
project doesnt depends on xdoclet plugin. But if the project uses xdoclet to
generate EJB, the I am getting below in my console


[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building EJBProject
[INFO]    task-segment: [clean, install]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory D:\Projects\EJBProject\target
[WARNING] Attempting to build MavenProject instance for Artifact
(org.codehaus.mojo:xdoclet-maven-plugin:1.0-beta-1-internal-FDS) of type:
maven-plugin; constructing POM artifact instead.
[INFO] [xdoclet:xdoclet {execution: default}]
[INFO] Initializing DocletTasks!!!
[INFO] Executing tasks
Generating Remote interface for 'com.XXXXXXXX'.
Generating Local interface for 'com.XXXXXXXX'.
Generating Home interface for 'com.XXXXXXXX'.
Generating Local Home interface for 'com.XXXXXXXX'.

The build is stopped or paused at this point. It never finishe its exection.
I do not know when xdoclet not running if i run with ProcessBuilder or
Runtime.exec() methods.

I searched on net but didnt get any solution to find the reason.

Please someone tell me why and how to solve this issue,

Thanks





--
View this message in context: http://maven.40175.n5.nabble.com/Xdoclet-not-generating-EJB-s-tp5713529.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: Xdoclet not generating EJB's

Posted by Wayne Fay <wa...@gmail.com>.
> Build successful in both the ways. However, my requirement want to build the
> project through Java API.
>
> Process pb = new ProcessBuilder("cmd.exe", "/C", getMavenHome() +
> "\\bin\\mvn.bat -f " + getProjectPath() + " -DskipTests=true clean
> install");

You realize this is not really "building the project through Java API"
but rather "calling the Maven executable on Windows from Java", right?


> [WARNING] Attempting to build MavenProject instance for Artifact
> (org.codehaus.mojo:xdoclet-maven-plugin:1.0-beta-1-internal-FDS) of type:
...
> Generating Local Home interface for 'com.XXXXXXXX'.
>
> The build is stopped or paused at this point. It never finishe its exection.

Download the Java code for the xdoclet plugin (it is open source) and
poke around. See what it does immediately after the System.out for
"Generating Local Home interface" line. Perhaps you will notice
something in the code which helps explains the results you are seeing.

Wayne

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


Re: Xdoclet not generating EJB's

Posted by Baskar D <db...@corelogic.com>.
I solved the problem using Runtime.exec() by passing command array to build
the ejb's. Now xdoclet generating EJB successfully.

Thank you very much Wayne Fay and Jorg for your suggestions.

--
View this message in context: http://maven.40175.n5.nabble.com/Xdoclet-not-generating-EJB-s-tp5713529p5713944.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Xdoclet not generating EJB's

Posted by Jörg Schaible <Jo...@scalaris.com>.
Hi,

Baskar D wrote:


> 
> Hi,
> 
> I am using xdoclet maven plug-in for generating EJB's. I configured
> xdoclet properly and able to generate EJB when I build the project through
> Netbeans IDE and command propmpt.
> 
> In Netbeans simple I can right click on project and select Clean and
> Build. In command prompt, I use the command mvn clean install.
> 
> Build successful in both the ways. However, my requirement want to build
> the project through Java API.
> 
> I tried to build the project like below ,
> 
> Process pb = new ProcessBuilder("cmd.exe", "/C", getMavenHome() +
> "\\bin\\mvn.bat -f " + getProjectPath() + " -DskipTests=true clean
> install");

[snip]

How do you define paths in your configuration for the XDoclet plugin? You 
have to use ${basedir} in the path definition of any fileset element or 
destination directory. Additionally the destDir attribute of the ejbdoclet 
task is completely moot (see MOJO-265), you have to define it for every 
subtask:

======= %< ========
 <configuration>
   <tasks>
     <ejbdoclet verbose="true" force="false" ejbSpec="2.0" 
destDir="${basedir}/target/MOJO-265">
       <fileset dir="${basedir}/src/main/java">
         <include name="**/*Bean.java" />
       </fileset>
       <homeinterface destDir="${basedir}/target/generated-sources/xdoclet" 
/>
       <remoteinterface destDir="${basedir}/target/generated-
sources/xdoclet" />
       <localhomeinterface destDir="${basedir}/target/generated-
sources/xdoclet" />
       <localinterface destDir="${basedir}/target/generated-sources/xdoclet" 
/>
       <deploymentdescriptor destDir="${basedir}/target/generated-
sources/ejb" />
       <weblogic destDir="${basedir}/target/generated-sources/ejb" 
version="8.1" datasource="MyDataSource" databaseType="ORACLE" 
createtables="Disabled" validateDbSchemaWith="MetaData" />
       <jboss destDir="${basedir}/target/generated-sources/ejb" 
version="3.2" datasource="MyDataSource" datasourceMapping="Oracle9i" 
createTable="false" alterTable="false" removeTable="false" />
     </ejbdoclet>
   </tasks>
 </configuration>
======= %< ========

- Jörg


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