Hi Andreas,
I am not sure that your fileset definition for the mockobjectdoclet is correct. You might be missing the sourcedir property if the source dir is different to the directory defined in your POM, like
maven.xdoclet.mockobjectdoclet.fileset.1.sourcedir=${basedir}/src/java
The other thing that you seem to be missing are the properties for the nested mockobjects task itself. You have to do something like
maven.xdoclet.mockobjectdoclet.mockobjects.0=true
to enable the mockobjects subtask.
For the missing library warning you can safely ignore it, the plugin will still work. If you want to get rid of it, edit the plugin.yelly file of the xdoclet plugin and remove the maven="maven" (or something like this, don't remove the wrong one :-)) in the project tag's namespace declarations.
Hope that helps.
Leander
Andreas Guther schrieb:
Hi:
I am having a hard time getting a MockObject generated within maven.
I have created the following goal in my maven.xml
<preGoal name="java:compile">
<attainGoal name="xdoclet:mockobjectdoclet"/>
</preGoal>
My projects.property file has the following entries:
# XDOCLET MockObjects settings maven.xdoclet.mockobjectdoclet.destDir=src/test maven.xdoclet.mockobjectdoclet.verbose=yes maven.xdoclet.mockobjectdoclet.fileset.1=true maven.xdoclet.mockobjectdoclet.fileset.1.include=**/*.java
The declared dependencies are the following:
(and I am not really sure if I need all of them, but at least I get no errors now)
<dependency> <groupId>xdoclet</groupId> <artifactId>xdoclet-xdoclet-module</artifactId> <version>1.2</version> <type>jar</type> <properties/> </dependency> <dependency> <groupId>xdoclet</groupId> <artifactId>xdoclet-mockobjects-module</artifactId> <version>1.2</version> <type>jar</type> <properties/> </dependency> <dependency> <groupId>xdoclet</groupId> <artifactId>xjavadoc</artifactId> <version>1.0.2</version> <type>jar</type> <url>http://xdoclet.sourceforge.net/</url> <properties/> </dependency> <dependency> <groupId>xdoclet</groupId> <artifactId>xdoclet-java-module</artifactId> <version>1.2</version> <type>jar</type> <url>http://www.ibiblio.org/maven/xdoclet/</url> <properties/> </dependency> <dependency> <groupId>xdoclet</groupId> <artifactId>xdoclet-mockobjects-module</artifactId> <version>1.2</version> <type>jar</type> <properties/> </dependency> <dependency> <groupId>mockobjects</groupId> <artifactId>mockobjects-core</artifactId> <version>0.07</version> <type>jar</type> <url>http://www.ibiblio.org/maven/mockobjects/</url> <properties/> </dependency>
If I run "maven java:compile" I get the following output:
C:\usr\local\sandboxes\M8\cp.projects.cp-unit-test>maven java:compile __ __ | \/ |__ _Apache__ ___ | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~ |_| |_\__,_|\_/\___|_||_| v. 1.0
Tag library requested that is not present: 'maven' in plugin: 'maven-xdoclet-plugin-1.2' build:start:
java:prepare-filesystem:
java:compile: xdoclet:mockobjectdoclet:
[echo] Compiling to C:\usr\local\sandboxes\M8\cp.projects.cp-unit-test/target/classes BUILD SUCCESSFUL Total time: 7 seconds Finished at: Wed Aug 18 12:43:11 PDT 2004
This looks fine but I have no generated source in the target directory.
I have then added a ant task to my maven.xml file and that creates the wanted Output:
<goal name="mock">
<!--
I have defined this goal since I am not able to generate the
MockObject using the Maven XDoclet plug-in directly.
-->
<ant:path id="xdoclet.lib.path">
<ant:fileset dir="C:/usr/local/xdoclet/xdoclet-1.2/lib">
<include name="*.jar"/> <include name="xdoclet-1.2.jar"/>
</ant:fileset>
</ant:path>
<ant:taskdef name="mockobjectdoclet" classname="xdoclet.modules.mockobjects.MockObjectDocletTask" classpathref="xdoclet.lib.path"/>
<ant:mockobjectdoclet destdir="src/test">
<ant:fileset dir="src/java">
<include name="**/*.java"/>
</ant:fileset>
<ant:mockobjects/>
</ant:mockobjectdoclet>
</goal>
This works for me but I rather would use the maven plugin than having to add such an additional ant task.
Any idea what might be missing or wrong?
I also wonder how to fix the following message Tag library requested that is not present: 'maven' in plugin: 'maven-xdoclet-plugin-1.2'
Thanks in advance for any help or hint.
Andreas --------------------------------------------------------
This electronic mail message contains information belonging to PaymentOne, which may be confidential and/or legal privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, printing, copying, distribution, or the taking of any action in reliance on the contents of this electronically mailed information is strictly prohibited. If you receive this message in error, please immediately notify us by electronic mail and delete this message. --------------------------------------------------------
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user