maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Wheeler <rwhee...@artifact-software.com>
Subject Re: Why does Maven fail to compile my project occasionally?
Date Thu, 20 Feb 2014 14:20:29 GMT
On 20/02/2014 4:38 AM, Stephen Connolly wrote:
> On 20 February 2014 01:58, LevskiWeng <levskiweng@gmail.com> wrote:
>
>> Wayne Fay wrote
>>> Maven calls out to your system JDK to do the compilation step. With
>>> the [ERROR] lines you provided previously, Maven is simply passing
>>> along the error that was reported by javac. I bet, if you constructed
>>> the proper javac call (which can be seen in Maven's logs if you use -X
>>> for debug mode), you would see the same error produced without
>>> involving Maven (or Jenkins) at all.
>>>
>>> IIRC you had some "cannot find symbol" errors. What do you expect
>>> Maven to do about code defects reported by the Java compiler? Why are
>>> you blaming Maven for this?
>> After digging into the dependency tree described in each module's pom.xml
>> for several days, I found that you're right. It's my fault, not Maven's.
>> It's because my code depends some other modules which I didn't put it into
>> pom.xml explicitly. And I'm adding them into the corresponding pom.xml.
>> Thank you for directing me back to the right track!
>>
>> However, I'm curious that I succeed to compile the project after several
>> compilation failure. How does it happen? I've passed the parameter 'clean
>> install -Dmaven.test.skip=true --update-snapshots --batch-mode --fail-fast
>> --debug -Dmaven.compiler.forceJavacCompilerUse=true
>> -Dmaven.compiler.verbose=true' to Maven, but it doesn't get the same error
>> when I compile the project the second time. And it mislead me to blame
>> Maven
>> ;-)
>>
>> Could anyone explain the somewhat weird behavior of Maven? Thanks.
>>
> Do you happen to have eclipse open while doing your tests?
>
> If the answer is yes, then eclipse could be doing some background
> compilation and just happen to write the files in place during your second
> time on the cli
Eclipse can resolve missing dependencies by looking at other projects in 
your workspace.
It is a good idea to turn this off so you don't make projects that only 
work in your workspace.

You can look at project properties to see where Eclipse is getting your 
dependencies
This can help track down the case where it builds in Eclipse or shows no 
errors in the imports while editing but will not build outside Eclipse.

Ron
>
>
>>
>>
>> --
>> View this message in context:
>> http://maven.40175.n5.nabble.com/Why-does-Maven-fail-to-compile-my-project-occasionally-tp5784849p5785441.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
>>
>>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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


Mime
View raw message