You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Daniele Dellafiore <il...@gmail.com> on 2010/09/13 19:05:51 UTC

compile failure warning and build succesfull?

Hi.

For the first time in years, I am shocked seeing a maven behavior:

[WARNING]    /contacts-client-rest/src/main/java/commons/rest/client/ContactsClient.java:[17,42]
cannot find symbol
symbol  : class Profile
location: class commons.rest.client.ContactsClient

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------

what is that?
How can the build be succesful if the compilations fails?
The trick here was that in Eclipse the build works cause Eclipse does
not honor the maven scope. The symbol maven can't fine here, class
Profile, is in a dep with test scope, so works in Eclipse, but not in
maven.

Actually, I expect the bahavior to be: BUILD FAILURE.

I see something strange here, dont' you?
Anywayt, there, is a way to change that default and make the build
fail if the compilations fails?

Thanks.

-- 
Daniele Dellafiore
http://danieledellafiore.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: compile failure warning and build succesfull?

Posted by DennisV <de...@salvesdevelopment.nl>.
I happened to have the same problem. However, in my case it was reproducible
both in Eclipse (with m2eclipse) and as command-line build.
The problem was resolved once I configured the maven compiler plugin to not
fork:
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>
	<version>2.5.1</version>
	<configuration>
		<fork>*false*</fork>
        ...      

According to  this <http://jira.codehaus.org/browse/MNG-5456>   bug in maven
3.0.x, this problem should not occur with maven 3.1.x. However, this was not
the case for me (using 3.1.1).



--
View this message in context: http://maven.40175.n5.nabble.com/compile-failure-warning-and-build-succesfull-tp2838009p5775406.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: compile failure warning and build succesfull?

Posted by latchoumi <la...@hotmail.com>.
Hi ildella,

Did you find a solution for this issue in your post. I am facing the same
problem. Tried setting the failOnError flag to true, but it didn't work. Its
considering a compiler error as a warning and not a error and its not
failing. Let me know what solution you ended up with?

Thanks,
Lakshmi
-- 
View this message in context: http://maven.40175.n5.nabble.com/compile-failure-warning-and-build-succesfull-tp2838009p3257743.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: compile failure warning and build succesfull?

Posted by Baptiste MATHUS <ml...@batmat.net>.
Well, Maven does no specific things here. It depends on javac behaviour.
What's your m-compiler-plugin config?
Didn't you set a property like
http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#failOnError
to
false?

Cheers

2010/9/13 Daniele Dellafiore <il...@gmail.com>

> yes it is, but the class with the warning has this method:
>
>   public ContactsServerResponse register(Profile profile) {
>
> and the corresponding import
>
> import lavazza.commons.profiles.core.domain.Profile;
>
> if the import is not found, the class just does not compile, and the
> project is not really compiled (that is, the .class aren't put in the
> target folder) and no test is even run.
>
> Now, I should have noticed the warning but I would prefer that this
> kind of situations, when the project is not being compiled at all,
> give an error and the build a failure.
> Maybe is a javac settings, I just need it to be fatal for my build.
>
> I had build and hudson working with no errors with this for two week.
> This is not fine.
>
> On Mon, Sep 13, 2010 at 7:50 PM, Joao Maciel <jo...@gmail.com> wrote:
> > Well, it seems to be a compilation warning, not a compilation error,
> in'it?
> >
> > On Mon, Sep 13, 2010 at 2:05 PM, Daniele Dellafiore <ildella@gmail.com
> >wrote:
> >
> >> Hi.
> >>
> >> For the first time in years, I am shocked seeing a maven behavior:
> >>
> >> [WARNING]
> >>
>  /contacts-client-rest/src/main/java/commons/rest/client/ContactsClient.java:[17,42]
> >> cannot find symbol
> >> symbol  : class Profile
> >> location: class commons.rest.client.ContactsClient
> >>
> >> [INFO]
> >> ------------------------------------------------------------------------
> >> [INFO] BUILD SUCCESSFUL
> >> [INFO]
> >> ------------------------------------------------------------------------
> >>
> >> what is that?
> >> How can the build be succesful if the compilations fails?
> >> The trick here was that in Eclipse the build works cause Eclipse does
> >> not honor the maven scope. The symbol maven can't fine here, class
> >> Profile, is in a dep with test scope, so works in Eclipse, but not in
> >> maven.
> >>
> >> Actually, I expect the bahavior to be: BUILD FAILURE.
> >>
> >> I see something strange here, dont' you?
> >> Anywayt, there, is a way to change that default and make the build
> >> fail if the compilations fails?
> >>
> >> Thanks.
> >>
> >> --
> >> Daniele Dellafiore
> >> http://danieledellafiore.net
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
>
>
> --
> Daniele Dellafiore
> http://danieledellafiore.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Re: compile failure warning and build succesfull?

Posted by Daniele Dellafiore <il...@gmail.com>.
yes it is, but the class with the warning has this method:

   public ContactsServerResponse register(Profile profile) {

and the corresponding import

import lavazza.commons.profiles.core.domain.Profile;

if the import is not found, the class just does not compile, and the
project is not really compiled (that is, the .class aren't put in the
target folder) and no test is even run.

Now, I should have noticed the warning but I would prefer that this
kind of situations, when the project is not being compiled at all,
give an error and the build a failure.
Maybe is a javac settings, I just need it to be fatal for my build.

I had build and hudson working with no errors with this for two week.
This is not fine.

On Mon, Sep 13, 2010 at 7:50 PM, Joao Maciel <jo...@gmail.com> wrote:
> Well, it seems to be a compilation warning, not a compilation error, in'it?
>
> On Mon, Sep 13, 2010 at 2:05 PM, Daniele Dellafiore <il...@gmail.com>wrote:
>
>> Hi.
>>
>> For the first time in years, I am shocked seeing a maven behavior:
>>
>> [WARNING]
>>  /contacts-client-rest/src/main/java/commons/rest/client/ContactsClient.java:[17,42]
>> cannot find symbol
>> symbol  : class Profile
>> location: class commons.rest.client.ContactsClient
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] BUILD SUCCESSFUL
>> [INFO]
>> ------------------------------------------------------------------------
>>
>> what is that?
>> How can the build be succesful if the compilations fails?
>> The trick here was that in Eclipse the build works cause Eclipse does
>> not honor the maven scope. The symbol maven can't fine here, class
>> Profile, is in a dep with test scope, so works in Eclipse, but not in
>> maven.
>>
>> Actually, I expect the bahavior to be: BUILD FAILURE.
>>
>> I see something strange here, dont' you?
>> Anywayt, there, is a way to change that default and make the build
>> fail if the compilations fails?
>>
>> Thanks.
>>
>> --
>> Daniele Dellafiore
>> http://danieledellafiore.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>



-- 
Daniele Dellafiore
http://danieledellafiore.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: compile failure warning and build succesfull?

Posted by Joao Maciel <jo...@gmail.com>.
Well, it seems to be a compilation warning, not a compilation error, in'it?

On Mon, Sep 13, 2010 at 2:05 PM, Daniele Dellafiore <il...@gmail.com>wrote:

> Hi.
>
> For the first time in years, I am shocked seeing a maven behavior:
>
> [WARNING]
>  /contacts-client-rest/src/main/java/commons/rest/client/ContactsClient.java:[17,42]
> cannot find symbol
> symbol  : class Profile
> location: class commons.rest.client.ContactsClient
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
>
> what is that?
> How can the build be succesful if the compilations fails?
> The trick here was that in Eclipse the build works cause Eclipse does
> not honor the maven scope. The symbol maven can't fine here, class
> Profile, is in a dep with test scope, so works in Eclipse, but not in
> maven.
>
> Actually, I expect the bahavior to be: BUILD FAILURE.
>
> I see something strange here, dont' you?
> Anywayt, there, is a way to change that default and make the build
> fail if the compilations fails?
>
> Thanks.
>
> --
> Daniele Dellafiore
> http://danieledellafiore.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>