RE: Maven and Unit Tests

2004-01-09 Thread Daniel Rabe
I do the same thing -- run everything from ant, then use maven to build the
web site. I think you can put:

maven.test.skip = true

in your project.properties to tell maven not to run the tests.

I also override the java:compile goal in my maven.xml:


  


My project.xml add the junit report to the list of reports to generate:


  ... (other reports) ...
  maven-junit-report-plugin


My batch file runs junit tests from ant, then calls "maven site:generate" to
generate the web site.

Hope this helps,
Daniel Rabe

-Original Message-
From: James Norman [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 09, 2004 4:05 PM
To: Maven Users List
Subject: Re: Maven and Unit Tests


I'm having no luck with this.  Running 
maven junit-report 
fails because it's not a valid goal.  If I don't set the
 then I won't get a Unit test report, even if I had
set the maven.test.reportsDirectory.  If I do include the
 in project.xml then Maven will try to compile and
run the tests.  I would like to be able to use the output from the tests
that were run from Ant to generate the unit tests report for the site.  Is
this possible?


On Fri, 2004-01-09 at 00:52, Matthieu RIOU wrote:
> I think the JUnit Report plug-in should do it. Just run :
>  
> maven junit-report
>  
> This will only work if your test output files are generated in the 
> standard directory, if not you'll have to override the 
> maven.test.reportsDirectory property.
> 
> James Norman <[EMAIL PROTECTED]> wrote:
> Hey All,
> I'm fairly new to Maven so be patient with me if this question has 
> already been answered. We have been using Ant to build our software 
> for some time now and are quite pleased with it. I'm now using Maven 
> to generate project information and take advantage of the canned 
> reports. I especially like the junit-report plugin. My question is if 
> I can take advantage of this report without running the Junit tests 
> through Maven. The tests are run through a target in Ant which is 
> called from a shell script in our nightly build. I would prefer not to 
> have to change anything in the Ant scripts as we have finally 
> standardized on something. Let me know if there is any way to generate 
> this report from the TEST-***.txt files.
> 
> Thanks,
> James
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! 
> Testez le nouveau Yahoo! Mail


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Overriding javadoc goals

2003-11-25 Thread Daniel Rabe
Thanks for the various suggestions that people posted. I think I got this
figured out (finally)! Here's what I do... tell me if I'm insane.

First I run ant to generate my javadocs:
ant javadoc > target\javadoc\report.txt

Then I run maven. The postGoal for xdoc:register-reports contains these
lines:


That just ensures that the links show up in my Project Reports.

Finally, my preGoal for xdoc:copy-user-resources converts the javadoc report
output to xml:


And the rest is automagic!

Thanks again to all who provided suggestions.

Daniel Rabe

-Original Message-
From: Daniel Rabe [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 24, 2003 7:44 PM
To: 'Maven Users List'
Subject: RE: Overriding javadoc goals


Yes, but then the javadoc report doesn't appear in the "Project Reports"
(what I was calling the table of contents).

--DanR

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 24, 2003 7:28 PM
To: Maven Users List
Subject: Re: Overriding javadoc goals


Can you de-register the javadoc report?
--
dIon Gillard, Multitask Consulting
Blog:  http://blogs.codehaus.org/people/dion/



Daniel Rabe <[EMAIL PROTECTED]> wrote on 25/11/2003 12:55:10 PM:

> I'm trying to make maven coexist peacefully with ant, and not having
much
> luck.
> 
> I'd like to use maven just for the website generation. I already have
ant
> files that compile, run junit, run javadoc, etc. Our developers all 
> use
ant,
> and know how to maintain the ant build files. Please don't tell me not
to
> use ant -- that just isn't going to be a reality on this project!
> 
> In this particular case, I'd like to use ant to run javadoc, and use
maven
> to build the web site. I run my ant script to generate the javadoc to
the
> expected directory (./target/docs/apidocs, with a report in 
> ./target/javadocs/report.txt). My project.xml contains: 
>...
>maven-junit-report-plugin
> 
> That way the web site will have the junit link in its table of 
> contents.
> 
> My maven.xml contains:
> 
> I was hoping this would prevent the javadoc plugin from running
javadoc...
> but it doesn't. It runs javadoc, overwriting what I did with ant. Is
there
> any way around this?
> 
> Thanks,
> Daniel Rabe
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: ant, junitreport, and maven

2003-11-25 Thread Daniel Rabe
If I were king, I might do everything with maven -- I think it's really
cool. But I've introduced maven to a project team that has standardized on
ant as the canonical build tool. I tried to let maven execute the tests, and
it works, but it keeps breaking as developers add dependencies to the ant
files but not the maven files. Soo rather than fighting an uphill
battle, I decided to let ant do the "real" work of compiling and testing,
and use maven for the web site generation.

BTW, thanks for the pointer to the source. I hadn't realized that the
plugins were all coded in jelly... now that I see the code, it's a little
easier to figure out what's going on. In fact, the solution to my
junitreport problem is trivial: I no longer override test:test to do
nothing, but do set maven.test.skip = true. That seems to do the trick!

Regards,
Daniel Rabe

-Original Message-
From: Brett Porter [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 25, 2003 4:32 PM
To: 'Maven Users List'
Subject: RE: ant, junitreport, and maven


~/.maven/plugins/maven-test-plugin-XXX/plugin.jelly is the plugin source, or
you are probably more interested in
~/.maven/plugins/maven-junit-report-plugin-XXX/plugin.jelly

Why don't you want maven to execute the tests?

- Brett

> -Original Message-
> From: Daniel Rabe [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 26 November 2003 9:44 AM
> To: 'Maven Users List'
> Subject: ant, junitreport, and maven
> 
> 
> More in my saga of trying to make ant and maven coexist...
> 
> I have an ant script that runs a bunch of unit tests. It puts
> the JUnit XML and TXT output in ./target/test-reports. I 
> would like maven's junit-report-plugin to generate the report 
> for me. Since I don't want maven to execute the tests, I 
> override the test:test goal in maven.xml:  name="test:test"/> This *almost* works! It prevents maven 
> from running the tests, and the junit report is generated. 
> However, maven-junit-report-plugin:report looks in {basedir} 
> for my XML files (the output from junit). It doesn't find 
> any, so the report says no tests were run. In comparsion, if 
> I do NOT override test:test, then when I run 
> maven-junit-report-plugin:report it looks for the XML files 
> in the proper place (./target/test-reports).
> 
> I'm stumped, and I haven't been able to get at the plugin
> source to see if I could figure something out.
> 
> Thanks for any help,
> --Daniel Rabe
> 
> 


ant, junitreport, and maven

2003-11-25 Thread Daniel Rabe
More in my saga of trying to make ant and maven coexist...

I have an ant script that runs a bunch of unit tests. It puts the JUnit XML
and TXT output in ./target/test-reports. I would like maven's
junit-report-plugin to generate the report for me. Since I don't want maven
to execute the tests, I override the test:test goal in maven.xml:  This *almost* works! It prevents maven from running the
tests, and the junit report is generated. However,
maven-junit-report-plugin:report looks in {basedir} for my XML files (the
output from junit). It doesn't find any, so the report says no tests were
run. In comparsion, if I do NOT override test:test, then when I run
maven-junit-report-plugin:report it looks for the XML files in the proper
place (./target/test-reports).

I'm stumped, and I haven't been able to get at the plugin source to see if I
could figure something out.

Thanks for any help,
--Daniel Rabe



Can't get to plugin sources via cvs or viewcvs?

2003-11-25 Thread Daniel Rabe
I wanted to look at the source code for some of the plugins. I followed the
links on their plugin pages to access viewcvs, but once I'm there I never
see any leaf nodes. I'm drilling down from
http://cvs.apache.org/viewcvs.cgi/maven/src/
<http://cvs.apache.org/viewcvs.cgi/maven/src/>  into plugins and
plugins-build. I also tried the cvs commands for the junit-report plugin,
and all I got from the checkout was a couple of empty directories.

Is there a different place I need to go for source?

Thanks,
Daniel Rabe



RE: Overriding javadoc goals

2003-11-24 Thread Daniel Rabe
Doh! Cut-and-paste typo... I was working on two problems at once (one with
JavaDoc, one with JUnit). My example should have shown the javadoc plugin
report being registered! Sorry! (If I don't register the javadoc plugin
report, then it doesn't show up in the Project Reports section of the web
site).

--Daniel Rabe

-Original Message-
From: Jason van Zyl [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 10:19 PM
To: Maven Users List
Subject: Re: Overriding javadoc goals


On Mon, 2003-11-24 at 20:55, Daniel Rabe wrote:
> I'm trying to make maven coexist peacefully with ant, and not having much
> luck.
> 
> I'd like to use maven just for the website generation. I already have ant
> files that compile, run junit, run javadoc, etc. Our developers all use
ant,
> and know how to maintain the ant build files. Please don't tell me not to
> use ant -- that just isn't going to be a reality on this project!

In fact we tell people to continue using Ant all the time. If Ant works
for you use Ant.

> In this particular case, I'd like to use ant to run javadoc, and use maven
> to build the web site. I run my ant script to generate the javadoc to the
> expected directory (./target/docs/apidocs, with a report in
> ./target/javadocs/report.txt). My project.xml contains:
> 
>   ...
>   maven-junit-report-plugin
> 


> That way the web site will have the junit link in its table of contents.
> 
> My maven.xml contains:
> 
> I was hoping this would prevent the javadoc plugin from running javadoc...
> but it doesn't. It runs javadoc, overwriting what I did with ant. Is there
> any way around this?

You should only be getting the junit report running. You shouldn't even
need to override the javadoc goal. This is a bug if that is happening.

> Thanks,
> Daniel Rabe
-- 
jvz.

Jason van Zyl
[EMAIL PROTECTED]
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Overriding javadoc goals

2003-11-24 Thread Daniel Rabe
Yes, but then the javadoc report doesn't appear in the "Project Reports"
(what I was calling the table of contents).

--DanR

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 24, 2003 7:28 PM
To: Maven Users List
Subject: Re: Overriding javadoc goals


Can you de-register the javadoc report?
--
dIon Gillard, Multitask Consulting
Blog:  http://blogs.codehaus.org/people/dion/



Daniel Rabe <[EMAIL PROTECTED]> wrote on 25/11/2003 12:55:10 PM:

> I'm trying to make maven coexist peacefully with ant, and not having
much
> luck.
> 
> I'd like to use maven just for the website generation. I already have
ant
> files that compile, run junit, run javadoc, etc. Our developers all 
> use
ant,
> and know how to maintain the ant build files. Please don't tell me not
to
> use ant -- that just isn't going to be a reality on this project!
> 
> In this particular case, I'd like to use ant to run javadoc, and use
maven
> to build the web site. I run my ant script to generate the javadoc to
the
> expected directory (./target/docs/apidocs, with a report in 
> ./target/javadocs/report.txt). My project.xml contains: 
>...
>maven-junit-report-plugin
> 
> That way the web site will have the junit link in its table of contents.
> 
> My maven.xml contains:
> 
> I was hoping this would prevent the javadoc plugin from running
javadoc...
> but it doesn't. It runs javadoc, overwriting what I did with ant. Is
there
> any way around this?
> 
> Thanks,
> Daniel Rabe
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Overriding javadoc goals

2003-11-24 Thread Daniel Rabe
I'm trying to make maven coexist peacefully with ant, and not having much
luck.

I'd like to use maven just for the website generation. I already have ant
files that compile, run junit, run javadoc, etc. Our developers all use ant,
and know how to maintain the ant build files. Please don't tell me not to
use ant -- that just isn't going to be a reality on this project!

In this particular case, I'd like to use ant to run javadoc, and use maven
to build the web site. I run my ant script to generate the javadoc to the
expected directory (./target/docs/apidocs, with a report in
./target/javadocs/report.txt). My project.xml contains:

...
maven-junit-report-plugin

That way the web site will have the junit link in its table of contents.

My maven.xml contains:

I was hoping this would prevent the javadoc plugin from running javadoc...
but it doesn't. It runs javadoc, overwriting what I did with ant. Is there
any way around this?

Thanks,
Daniel Rabe



Running the StatCVS plug-in more than once?

2003-11-10 Thread Daniel Rabe
Some of our managers really like the StatCVS reports. Currently the plug-in
runs and analyzes our entire CVS tree. What I'd *really* like to be able to
do is run it once on the entire repository, and run it AGAIN to produce
another set of reports based ONLY on the unit-test sub-tree of our
repository. I can't think of a way to do this -- any ideas?

Thanks,
Daniel Rabe



RE: Getting cactus error output into the report

2003-11-10 Thread Daniel Rabe
Thanks Vincent - the new bug report is MAVEN-1019.

-Original Message-
From: Vincent Massol [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 08, 2003 5:45 AM
To: 'Maven Users List'
Cc: [EMAIL PROTECTED]
Subject: RE: Getting cactus error output into the report


Ok, I've had a better look. I was right. The cactus.jsl is an exact copy of
the junit-report's junit.jsl file which does not display stack trace. So I'd
say you should open a bug report against the junit-report plugin and I'll
make sure that I update Cactus's cactus.jsl file.

Thanks
-Vincent

> -Original Message-
> From: Vincent Massol [mailto:[EMAIL PROTECTED]
> Sent: 08 November 2003 12:27
> To: 'Maven Users List'
> Cc: [EMAIL PROTECTED]
> Subject: RE: Getting cactus error output into the report
> 
> Oops. Actually this may not be true. I had forgotten there was a 
> cactus.jsl file in the cactus plugin. I'll have a look and fix this.
> 
> Thanks
> -Vincent
> 
> > -Original Message-
> > From: Vincent Massol [mailto:[EMAIL PROTECTED]
> > Sent: 08 November 2003 11:56
> > To: 'Maven Users List'
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: Getting cactus error output into the report
> >
> > Hi Daniel,
> >
> > It looks like it's a limitation of the Maven junit-report plugin.
> Could
> > you post a JIRA improvement report for the junit-report plugin.
> Although
> > I haven't tested it, I believe you'll also not see stack trace 
> > information for pure junit tests when using Maven.
> >
> > Thanks
> > -Vincent
> >
> > > -Original Message-
> > > From: Daniel Rabe [mailto:[EMAIL PROTECTED]
> > > Sent: 04 November 2003 01:34
> > > To: '[EMAIL PROTECTED]'
> > > Subject: Getting cactus error output into the report
> > >
> > > I'm using maven with the cactus plugin on Windows XP. If one of my
> > cactus
> > > tests gets an error (it throws an exception), a stack trace is
> emitted
> > > into
> > > the .txt and .xml files in target/test-cactus-reports/tomcat5x.
> > However,
> > > the
> > > report that's generated by the cactus plugin only shows the
> exception
> > > message. It would really be helpful to have the actual stack trace
> in
> > the
> > > report. Is there any way I can configure maven and/or the cactus
> > plugin to
> > > do this?
> > >
> > > Thanks,
> > > Daniel Rabe
> >
> >
> >
> >
-
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



RE: problems running ant tasks from maven

2003-11-06 Thread Daniel Rabe
Googling the maven web site for "root ClassLoader" turned up one promising
page, http://maven.apache.org/reference/developers/developer-guide.html.
However, the current page (generated 03 November) doesn't even contain the
word ClassLoader. Google's cached page (from 07 October) DOES mention it, at
least in the context of developing a plugin.

Now I get an "INTERNAL ERROR":
Reference made to goal 'java:jar-resources' which has no definition.

--Daniel Rabe

-Original Message-
From: Brett Porter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 6:45 PM
To: 'Maven Users List'
Subject: RE: problems running ant tasks from maven


You probably need to add a junit dependency to your project. You might need
to put it in the root classloader (google the maven website).

Anyway, you can integrate your ant script into maven.xml really easily. I'd
recommend trying that. Actually, I'd recommend the test plugin above all of
these, although I'm assuming this doesn't suite your needs.

- Brett


> -Original Message-
> From: Daniel Rabe [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 6 November 2003 12:33 PM
> To: '[EMAIL PROTECTED]'
> Subject: problems running ant tasks from maven
> 
> 
> I have an existing ant task set up to run junit. If I invoke
> it from the command line with "ant test", it works fine. I 
> want to integrate this into maven, so I added the following 
> to maven.xml:
> 
> 
> 
> 
> 
> When I run "maven zzz" it fails (error messages below). Why
> would it not run from within maven when it runs fine from the 
> command line?
> 
> Thanks,
> Daniel Rabe
> 
> 
> BUILD FAILED
> File.. file:/C:/KangaHermes/ 
> Element... ant
> Line.. 36
> Column 24
> Could not create task or type of type: junit.
> 
> Ant could not find the task or a class this task relies upon.
> 
> This is common and has a number of causes; the usual solutions are to 
> read the manual pages then download and install needed JAR files, or 
> fix the build file:
>  - You have misspelt 'junit'.
>Fix: check your spelling.
>  - The task needs an external JAR file to execute
>and this is not found at the right place in the classpath.
>Fix: check the documentation for dependencies.
>Fix: declare the task.
>  - The task is an Ant optional task and optional.jar is absent
>Fix: look for optional.jar in ANT_HOME/lib, download if needed
>  - The task was not built into optional.jar as dependent
>libraries were not found at build time.
>Fix: look in the JAR to verify, then rebuild with the needed
>libraries, or download a release version from apache.org
>  - The build file was written for a later version of Ant
>Fix: upgrade to at least the latest release version of Ant
>  - The task is not an Ant core or optional task
>and needs to be declared using .
> 
> Remember that for JAR files to be visible to Ant tasks
> implemented in ANT_HOME/lib, the files must be in the same 
> directory or on the classpath
> 
> Please neither file bug reports on this problem, nor email
> the Ant mailing lists, until all of these causes have been 
> explored, as this is not an Ant bug. Total time: 9 seconds 
> Finished at: Wed Nov 05 18:32:23 MST 2003
> 


problems running ant tasks from maven

2003-11-05 Thread Daniel Rabe
I have an existing ant task set up to run junit. If I invoke it from the
command line with "ant test", it works fine. I want to integrate this into
maven, so I added the following to maven.xml:





When I run "maven zzz" it fails (error messages below). Why would it not run
from within maven when it runs fine from the command line?

Thanks,
Daniel Rabe


BUILD FAILED
File.. file:/C:/KangaHermes/  
Element... ant
Line.. 36
Column 24
Could not create task or type of type: junit.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
 - You have misspelt 'junit'.
   Fix: check your spelling.
 - The task needs an external JAR file to execute
   and this is not found at the right place in the classpath.
   Fix: check the documentation for dependencies.
   Fix: declare the task.
 - The task is an Ant optional task and optional.jar is absent
   Fix: look for optional.jar in ANT_HOME/lib, download if needed
 - The task was not built into optional.jar as dependent
   libraries were not found at build time.
   Fix: look in the JAR to verify, then rebuild with the needed
   libraries, or download a release version from apache.org
 - The build file was written for a later version of Ant
   Fix: upgrade to at least the latest release version of Ant
 - The task is not an Ant core or optional task
   and needs to be declared using .

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.
Total time: 9 seconds
Finished at: Wed Nov 05 18:32:23 MST 2003


cactus plugin and overring war:war

2003-11-05 Thread Daniel Rabe
I'm still a maven novice, so maybe someone can clue me in. I'm seeing some
very strange behavior that I just don't understand.

I've been playing with the cactus plugin. I've succeeded in building a war,
cactifying it, and running the cactus tests. Awesome! BUT then I decided I'd
rather let ant build my war for me. (Our project team has standardized on
ant for make scripts, so I'd rather maintain only one version of the build
files). So I override "war:war" in my maven.xml:





I run "maven cactus", and it builds my war file, but then gives an error:

BUILD FAILED
File.. file:/c:/temp/maven/plugins/maven-cactus-plugin-3.1/
 
Element... ant:taskdef
Line.. 51
Column 75
taskdef class org.apache.cactus.integration.ant.CactusTask cannot be found
Total time: 9 seconds

What does this mean?

Is it generally unsafe to override goals like I'm trying to do? Is there a
better way to delegate behavior to an ant script?

Note that if I remove my "war:war" goal and perform my ant build in a
postGoal for "war:war", the error doesn't occur.

Thanks,
Daniel Rabe




Getting cactus error output into the report

2003-11-03 Thread Daniel Rabe
I'm using maven with the cactus plugin on Windows XP. If one of my cactus
tests gets an error (it throws an exception), a stack trace is emitted into
the .txt and .xml files in target/test-cactus-reports/tomcat5x. However, the
report that's generated by the cactus plugin only shows the exception
message. It would really be helpful to have the actual stack trace in the
report. Is there any way I can configure maven and/or the cactus plugin to
do this?

Thanks,
Daniel Rabe



Environment variables in project.properties?

2003-11-03 Thread Daniel Rabe
I'd really like to be able to use environment variables in my
project.properties. For example, instead of:

cactus.home.tomcat5x = C:/Program Files/Apache Software Foundation/Tomcat
5.0

I'd like to be able to say something like this:

cactus.home.tomcat5x =${TOMCAT_HOME}

I wasn't able to find anything in the maven documentation... is there a way
to do this?

Thanks,
Daniel Rabe