[XDoclet-JIRA] Commented: (XDT-1486) xdoclet-jboss-module breaks xdoclet:ejbdoclet maven target

"Felipe Desiderati (JIRA)" <[email protected]>
Newsgroups gmane.comp.java.xdoclet.devel
Message-ID <[email protected]>
    [ http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1486?page=comments#action_17232 ] 

Felipe Desiderati commented on XDT-1486:
----------------------------------------

I am having the same problem described, and with the same enviroment specifications. First, I wasted a feel hours to track the problem and then I tried a lot of things: I tried another version (1.2.2, 1.2.1) and doesn't work; I tried remove all dependencies in project.xml which the plugin provides and doesn't work; ... Nothing happens.

After that, I had an Idea... to copy the xdoclet:ejbdoclet goal from plugin.jelly to my maven.xml file. So my maven.xml file looks like:
        ...
        <!-- I simplified the code for tests -->
	<goal description="ejbdoclet" name="xdoclet-test:ejbdoclet">
		<taskdef name="ejbdoclet" classname="xdoclet.modules.ejb.EjbDocletTask">
			<classpath>
                                <!-- Add a dependency to classpath. -->
				<path refid="maven.dependency.classpath"/>
                                <!-- Not necessary add to classpath other dependency. All dependencies are declared in project.xml. -->
			</classpath>
		</taskdef>
		<ejbdoclet ejbSpec="2.0" destDir="${xdoclet.dest.dir}">
			<echo>Start Test...</echo>			
			<fileset dir="${xdoclet.src.dir}" includes="**/*Bean.java"></fileset>
			<packageSubstitution packages="bean" substituteWith="interfaces"></packageSubstitution>
			
			<jboss Version="3.0" destDir="${xdoclet.conf.dir}/META-INF"></jboss>
			<deploymentdescriptor destDir="${xdoclet.conf.dir}/META-INF"></deploymentdescriptor>

			<homeinterface></homeinterface>
			<remoteinterface></remoteinterface>

			<echo>End Test...</echo>			
		</ejbdoclet>

		<path id="ejbdoclet.java.compile.src.set" location="${maven.xdoclet.ejbdoclet.destDir}"/>
		<maven:addPath id="maven.compile.src.set" refid="ejbdoclet.java.compile.src.set"/>
	</goal>
        ...

And then, I add all the dependencies in my project.xml: (PS: I used 1.2.3 Xdoclet version in my depenpencies [commons-collections, commons-logging, log4j, xdoclet, xdoclet-xdoclet-module, xdoclet-ejb-module, xdoclet-web-module, xdoclet-hibernate-module, xdoclet-jdo-module, xdoclet-jmx-module, xdoclet-portlet-module, xjavadoc] and [xdoclet-jboss-module, jboss-j2ee, servletapi]). And Believe... WORKS!!!

Now, I needed make a test using a Maven Plugin. So I created a simple Maven Plugin, that is, nothing less, a simple copy form the example above. (See zipped file in attach xdoclet_v1.zip). And............. Believe.............. WORKS!!!

So, I saw the problem. The problem is on declaration of plugin dependencies in plugin.jelly. See below:
	...
	<classpath>
		<path refid="maven.dependency.classpath"/>

		<!-- Problem in this declarations. If you remove this, and put the dependencies in your project.xml. The plugin will work. ????? -->
		<pathelement path="${plugin.getDependencyPath('xdoclet:xdoclet-ejb-module')}"/>                
		<pathelement path="${plugin.getDependencyPath('xdoclet:xdoclet')}"/>
		<pathelement path="${plugin.getDependencyPath('xjavadoc:xjavadoc')}"/>
		<pathelement path="${plugin.getDependencyPath('xdoclet:xdoclet-xdoclet-module')}"/>
		<pathelement path="${plugin.getDependencyPath('commons-collections:commons-collections')}"/>
		<pathelement path="${plugin.getDependencyPath('commons-logging:commons-logging')}"/>
		<pathelement path="${plugin.getDependencyPath('log4j:log4j')}"/>
	</classpath>
	...

But when I odd the <pathelement .../> declarations to plugin.jelly and odd the dependencies in project.xml file, and repack the plugin... the program still WORKED. (See zipped file in attach xdoclet_v2.zip)

At end, I make my last test, I removed the dependencies from my project.xml, and .... THE PROGRAM NOT WORK!!! So I found something: IF YOU ADD (COPY FROM PLUGIN PROJECT.XML) THE DEPENDENCIES IN YOUR PROJECT.XML, THE PROGRAM WORKS!!!

But, I wasn't satisfied. So I verified (including and removing the dependencies in my project.xml) that if you use xdoclet-jboss-module, YOU MUST define xdoclet-web-module and xdoclet-jmx-module.

So, we have two alternatives: one is declare this two dependencies in our project.xml, when always we want use jboss module; and another alernative is add these two lines in plugin.jelly:

	...
	<classpath>
		....

                <pathelement path="${plugin.getDependencyPath('xdoclet:xdoclet-web-module')}"/>
		<pathelement path="${plugin.getDependencyPath('xdoclet:xdoclet-jmx-module')}"/>
	</classpath>
	...

Thanks, Felipe.
PS: I suggest put some link in section Advanced > Maven Plugin explaining the issue, because in this section exists an example using Jboss!!!

> xdoclet-jboss-module breaks xdoclet:ejbdoclet maven target
> ----------------------------------------------------------
>
>          Key: XDT-1486
>          URL: http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1486
>      Project: XDoclet
>         Type: Bug
>   Components: Maven Plugin, JBoss Module
>     Versions: 1.2.3
>  Environment: JDK 1.5.0 (Windows XP), Maven 1.0.2, XDoclet 1.2.3
>     Reporter: Fredrik Vraalsen
>     Assignee: xdoclet-devel (Use for new issues)
>  Attachments: maven-xdoclet-output-with-jboss-module.txt, maven-xdoclet-output-without-jboss-module.txt, project.properties, project.xml
>
>
> I am unable to get the Maven plugin to generate the jboss.xml file.  As per the instructions on the XDoclet Maven plugin webpage, I tried adding xdoclet-jboss-module-1.2.3.jar to my project dependencies.
> As the xdoclet-jboss-module-1.2.3.jar is not available from the ibiblio maven repository I copied the file manually into my local maven repository.
> However, when I add the jboss module to my dependencies, the xdoclet:ejbdoclet target doesn't work at all.  None of the other files are generated either, it just finishes without any output or error messages whatsoever.
> I'm attaching my project.properties, project.xml as well as the output captured from the command 'maven -o -X xdoclet:ejbdoclet' both with and without the jboss module in my project dependencies.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.