You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Irfan Sayed <ir...@gmail.com> on 2013/10/10 05:42:39 UTC

maven compiler plugin

hi,

i am using maven compiler plugin. i havent mentioned anything related to
plugin in POM.xml

i have just used the command on command prompt
mvn compiler:compile
what is happening is , above command compiles the test classes also .
however which should not be the case

in my opinion, only main java source files should get compiled and when i
execute compiler:testcompile goal , then only test classes should get
compile

please suggest how to just compile main source files and skip test cases
compilation

regards

Re: maven compiler plugin

Posted by Baptiste Mathus <bm...@batmat.net>.
+1.
And BTW you should be aware that calling a dedicated goal should actually
be a rare use case using Maven. Maybe even more calling the compiler
outside the standard lifecycle.
Just type mvn compile for your first case and mvn test-compile for the
second one (not that last one would also compile SRC/main sources btw).
Cheers
Le 10 oct. 2013 14:44, "Russell Gold" <ru...@gold-family.us> a écrit :

> Hi Irfan,
>
> The behavior you describe sounds surprising. Can you attach a full listing
> of the run when you do mvn compile:compile?
>
> Thanks,
> Russ
>
> On Oct 9, 2013, at 11:42 PM, Irfan Sayed <ir...@gmail.com> wrote:
>
> > hi,
> >
> > i am using maven compiler plugin. i havent mentioned anything related to
> > plugin in POM.xml
> >
> > i have just used the command on command prompt
> > mvn compiler:compile
> > what is happening is , above command compiles the test classes also .
> > however which should not be the case
> >
> > in my opinion, only main java source files should get compiled and when i
> > execute compiler:testcompile goal , then only test classes should get
> > compile
> >
> > please suggest how to just compile main source files and skip test cases
> > compilation
> >
> > regards
>
> -----------------
> Author, Getting Started with Apache Maven <
> http://www.packtpub.com/getting-started-with-apache-maven/video>
>
> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> and listen to the Misfile radio play <
> http://www.fuzzyfacetheater.com/misfile/>!
>
>
>
>
>
>
>
>

Re: maven compiler plugin

Posted by Russell Gold <ru...@gold-family.us>.
Hi Irfan,

The behavior you describe sounds surprising. Can you attach a full listing of the run when you do mvn compile:compile?

Thanks,
Russ

On Oct 9, 2013, at 11:42 PM, Irfan Sayed <ir...@gmail.com> wrote:

> hi,
> 
> i am using maven compiler plugin. i havent mentioned anything related to
> plugin in POM.xml
> 
> i have just used the command on command prompt
> mvn compiler:compile
> what is happening is , above command compiles the test classes also .
> however which should not be the case
> 
> in my opinion, only main java source files should get compiled and when i
> execute compiler:testcompile goal , then only test classes should get
> compile
> 
> please suggest how to just compile main source files and skip test cases
> compilation
> 
> regards

-----------------
Author, Getting Started with Apache Maven <http://www.packtpub.com/getting-started-with-apache-maven/video>

Come read my webnovel, Take a Lemon <http://www.takealemon.com>, 
and listen to the Misfile radio play <http://www.fuzzyfacetheater.com/misfile/>!