You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Rafael Schloming <ra...@redhat.com> on 2006/11/13 19:53:46 UTC

mvn questions

The maven build seems to be working for me now, but I've run into a few 
questions:

Is there an equivalent of ant -projecthelp? How do I find out what goals 
are available for the Qpid project?

Are there equivalents for all the ant targets? For example how do I 
build without running all the tests?

Are there any good maven background docs I should read?

Thanks,

--Rafael

Re: mvn questions

Posted by Daniel Kulp <da...@iona.com>.
On Monday November 13 2006 7:26 pm, Steven Shaw wrote:
> Why not move to testng?
>
> Apparently it has a maven2 plugin. TestNG looks better than Junit4 to
> me.

testng works quite well in maven.   I played around with it a while ago 
and it does work. 

The biggest problem with testng from my perspective is that the eclipse 
integration sucks compared to junit3.  There is a testng plugin for 
eclipse, but it's not nearly as integrated as junit is which makes 
running and debugging tests from within eclipse a lot harder and a lot 
less elegant.

I don't know about Idea/Intellij integration.   I never looked at that.

For the most part, JUnit 3 is the best bet at this point.   


-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194   F:781-902-8001
daniel.kulp@iona.com

Re: mvn questions

Posted by Steve Vinoski <vi...@iona.com>.
On Nov 13, 2006, at 7:26 PM, Steven Shaw wrote:

> Why not move to testng?
>
> Apparently it has a maven2 plugin. TestNG looks better than Junit4  
> to me.

Yep, that's another possibility, but I don't know how big the  
required changes would be, nor do I know how well TestNG works. I  
proposed junit3 primarily because it's a minimal change and it's a  
known quantity as far as maven goes.

--steve

Re: mvn questions

Posted by Steven Shaw <st...@gmail.com>.
Why not move to testng?

Apparently it has a maven2 plugin. TestNG looks better than Junit4 to me.

Re: mvn questions

Posted by Steve Vinoski <vi...@iona.com>.
On Nov 13, 2006, at 1:53 PM, Rafael Schloming wrote:

> The maven build seems to be working for me now, but I've run into a  
> few questions:
>
> Is there an equivalent of ant -projecthelp? How do I find out what  
> goals are available for the Qpid project?

I don't think maven2 supports listing of goals, since goals can  
effectively be dynamically added at runtime via plugins.

You might try this quick-start guide:

<http://maven.apache.org/guides/getting-started/maven-in-five- 
minutes.html>

There's also a free maven book available from here:

<http://www.mergere.com/m2book_download.jsp>

> Are there equivalents for all the ant targets? For example how do I  
> build without running all the tests?

There's currently no equivalent for the testreport targets, but they  
could be added.

This raises a bigger issue, though, which comes back to junit4 vs.  
junit3. The maven surefire plugin, as we've discussed before, doesn't  
work with junit4, which forced me to use the antrun plugin to run the  
tests. We lose a lot by doing that, such as better test reporting,  
code coverage, etc.

Furthermore, somebody was just saying that they still expect part of  
the code -- was it the client? -- to build with jdk 1.4. Since the  
tests use annotations, they won't be able to build the tests with  
1.4, which would seem to overly complicate matters.

I'll therefore recommend once again that we go back to junit3. The  
changes are largely syntactic, as junit4 does not really offer a huge  
leap in functionality over junit3. While 4 is mathematically greater  
than 3, in this case junit4 winds up being a lot less than junit3  
when you look at the big picture. I'm willing to do all the work to  
make the changes to the tests, too.

> Are there any good maven background docs I should read?

See above.

--steve

>
> Thanks,
>
> --Rafael


Re: mvn questions

Posted by Daniel Kulp <da...@iona.com>.
On Monday November 13 2006 1:53 pm, Rafael Schloming wrote:
> The maven build seems to be working for me now, but I've run into a few
> questions:
>
> Is there an equivalent of ant -projecthelp? How do I find out what
> goals are available for the Qpid project?

Maven doesn't really have the "named goals" thing that ant has.   
Developers usually interact with it via a lifecycle.   ALL maven projects 
have the same lifecycles.   That's what makes maven nice.   All projects 
are pretty much the same for the normal usage. 

The normal ones that most developers use are:

mvn process-sources
mvn compile
mvn process-test-sources
mvn test-compile
mvn test
mvn install

If a project follows the "standards" for layouts and stuff, the above just 
works with pretty much no configuration needed in the poms.    However, 
you normally would bind additional plugins into the lifecycle.   For 
example, for javadoc, you would bind the javadoc plugin into the package 
phase (or other phase).    Alternatively, you can invoke plugins 
directly:
mvn javadoc:javadoc  
(That's plugin:goal)

The most popular usage of something like that would be:
mvn cobertura:cobertura
or 
mvn clover:clover
which would normally run the code coverage on your tests. (see below for 
discussion on that issue)
   
> Are there equivalents for all the ant targets? For example how do I
> build without running all the tests?

With a NORMAL maven build, you can run "mvn -Dmaven.test.skip=true".  
There is actually a profile setup in your pom where you could 
do "mvn -Pfastinstall" which would skip the checkstyle/pmd things, tests, 
etc...

That said, because you aren't using surefire to run the tests (it's using 
antrun), that doesn't work.    Also, by not using surefire, a ton of 
other things won't work correctly (like code coverage metrics).  My 
STRONG suggestion is to go to JUnit 3 and just use surefire.   It 
simplifies things greatly and is "plug and play" with the other maven 
plugins.

> Are there any good maven background docs I should read?

Start with "Better Builds with Maven":
http://www.mergere.com/m2book_download.jsp


-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194   F:781-902-8001
daniel.kulp@iona.com