You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by raju <ra...@hotmail.com> on 2007/01/11 13:50:02 UTC

Maven Compiler plugin

Hi,
I am trying to compile files in a folder and move them to a directory. It
gives the following error:
Diagnosis: Compilation failure
FATAL ERROR: Error executing Maven for a project
org.apache.maven.BuildFailureException: Compilation failure
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
Read a lot of similar messages but am not clear what exactly causes this.
<plugin>
       <artifactId>maven-compiler-plugin</artifactId>
       
       <executions>
         <execution>
           
           <phase>compile</phase>
           <goals>
             <goal>compile</goal>
           </goals>
           <configuration>
             <sourceDirectory>wrappers</sourceDirectory>
   			<outputDirectory>target/classes</outputDirectory>
           </configuration>
         </execution>
       </executions>
     </plugin> 

Regards
Raju
-- 
View this message in context: http://www.nabble.com/Maven-Compiler-plugin-tf2958588s177.html#a8276651
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: Maven Compiler plugin

Posted by "dawn.angelito" <da...@simulalabs.com>.
Hi Raju,

There's actually a compilation error. Did you run Maven using the -X switch?
This must have caused the stacktrace produced. Try to compile again without
using this switch and see the source file(s) that failed to compile.

Hope this helps.

Dawn


raju wrote:
> 
> Hi,
> I am trying to compile files in a folder and move them to a directory. It
> gives the following error:
> Diagnosis: Compilation failure
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.BuildFailureException: Compilation failure
> 	at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
> Read a lot of similar messages but am not clear what exactly causes this.
> <plugin>
>        <artifactId>maven-compiler-plugin</artifactId>
>        
>        <executions>
>          <execution>
>            
>            <phase>compile</phase>
>            <goals>
>              <goal>compile</goal>
>            </goals>
>            <configuration>
>              <sourceDirectory>xyz</sourceDirectory>
>    			<outputDirectory>target/classes</outputDirectory>
>            </configuration>
>          </execution>
>        </executions>
>      </plugin> 
> 
> Regards
> Raju
> 

-- 
View this message in context: http://www.nabble.com/Maven-Compiler-plugin-tf2958588s177.html#a8291130
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: Maven Compiler plugin

Posted by franz see <fr...@gmail.com>.
Good day to you, raju,

Actually, you'd only have to bind your goals to the phases. Then just call a
phase ( i.e. mvn install ) and it will call execute every phase before it (
executing a phase means executing every goal bound to that phase ), before
executing that phase itself (i.e. install ).

For more info, you can take a look at [1].

Cheers,
Franz

[1] http://docs.codehaus.org/display/MAVENUSER/introduction-to-the-lifecycle


raju wrote:
> 
> Hi ,
> 
> Thanks everybody for your suggestions.
> 
> I was able to compile the same using ant-run-plugin and invoking javac
> task from within maven.Maybe i was not setting <sourceDirectory> element
> properly in maven.Now i am able to compile using maven-compiler-plugin
> also.
> 
> But is there a way i can chain life cycle phase.For example i am using
> <phase>generate-sources</phase> for ant-run-plugin with run goal and
> <phase>compile</phase> with goal as compile for maven-compiler-plugin .
> 
> Regards
> Raju
> 
> 
> 
> franz see wrote:
>> 
>> Good day to you, Raju,
>> 
>> I agree with Dawn. It is most likely a simple compilation error on your
>> java files ( and you probably used -X or --debug which would explain why
>> that stacktrace was shown. note: your code did not throw the exception,
>> maven did ). Check the output logs on your console again, you will see
>> the compilation error.
>> 
>> Furthermore, AFAIK, using a non-existing parameter under the plugin's
>> configuration tag will not produce any error. But it will not warn you of
>> such as well. 
>> 
>> Anyway, just check the output log in your console again and you would
>> most probably see there the compilation error on your java files.
>> 
>> Cheers,
>> Franz
>> 
>> 
>> raju wrote:
>>> 
>>> Hi Wendy,
>>> 
>>> I just wanted to compile some java files in a source folder and move
>>> compiled files to some destination directory.I have put this under build
>>> section of pom file only.I gave <sourcedirectory>just after <build>
>>> element.It says compiling n number of files then throws this compilation
>>> error.
>>> 
>>> Regards
>>> Raju
>>> 
>>> 
>>> 
>>> Wendy Smoak-3 wrote:
>>>> 
>>>> On 1/11/07, raju <ra...@hotmail.com> wrote:
>>>>>
>>>>> Hi,
>>>>> I am trying to compile files in a folder and move them to a directory.
>>>>> It
>>>>> gives the following error:
>>>>> Diagnosis: Compilation failure
>>>>> FATAL ERROR: Error executing Maven for a project
>>>>> org.apache.maven.BuildFailureException: Compilation failure
>>>>>         at
>>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
>>>>> Read a lot of similar messages but am not clear what exactly causes
>>>>> this.
>>>>> <plugin>
>>>>>        <artifactId>maven-compiler-plugin</artifactId>
>>>>>
>>>>>        <executions>
>>>>>          <execution>
>>>>>
>>>>>            <phase>compile</phase>
>>>>>            <goals>
>>>>>              <goal>compile</goal>
>>>>>            </goals>
>>>>>            <configuration>
>>>>>              <sourceDirectory>wrappers</sourceDirectory>
>>>> 
>>>> I don't see 'sourceDirectory' as a configuration element for the
>>>> compile goal:
>>>> http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html
>>>> 
>>>> It's actually a child element of <build>:
>>>> http://maven.apache.org/ref/2.0.4/maven-model/maven.html
>>>> 
>>>> In general, each module can have only one sourceDirectory and one
>>>> testSourceDirectory.
>>>> 
>>>> What are you trying to do?
>>>> 
>>>> -- 
>>>> Wendy
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-Compiler-plugin-tf2958588s177.html#a8292768
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: Maven Compiler plugin

Posted by raju <ra...@hotmail.com>.
Hi ,

Thanks everybody for your suggestions.

I was able to compile the same using ant-run-plugin and invoking javac task
from within maven.Maybe i was not setting <sourceDirectory> element properly
in maven.Now i am able to compile using maven-compiler-plugin also.

But is there a way i can chain life cycle phase.For example i am using
<phase>generate-sources</phase> for ant-run-plugin with run goal and
<phase>compile</phase> with goal as compile for maven-compiler-plugin .

Regards
Raju



franz see wrote:
> 
> Good day to you, Raju,
> 
> I agree with Dawn. It is most likely a simple compilation error on your
> java files ( and you probably used -X or --debug which would explain why
> that stacktrace was shown. note: your code did not throw the exception,
> maven did ). Check the output logs on your console again, you will see the
> compilation error.
> 
> Furthermore, AFAIK, using a non-existing parameter under the plugin's
> configuration tag will not produce any error. But it will not warn you of
> such as well. 
> 
> Anyway, just check the output log in your console again and you would most
> probably see there the compilation error on your java files.
> 
> Cheers,
> Franz
> 
> 
> raju wrote:
>> 
>> Hi Wendy,
>> 
>> I just wanted to compile some java files in a source folder and move
>> compiled files to some destination directory.I have put this under build
>> section of pom file only.I gave <sourcedirectory>just after <build>
>> element.It says compiling n number of files then throws this compilation
>> error.
>> 
>> Regards
>> Raju
>> 
>> 
>> 
>> Wendy Smoak-3 wrote:
>>> 
>>> On 1/11/07, raju <ra...@hotmail.com> wrote:
>>>>
>>>> Hi,
>>>> I am trying to compile files in a folder and move them to a directory.
>>>> It
>>>> gives the following error:
>>>> Diagnosis: Compilation failure
>>>> FATAL ERROR: Error executing Maven for a project
>>>> org.apache.maven.BuildFailureException: Compilation failure
>>>>         at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
>>>> Read a lot of similar messages but am not clear what exactly causes
>>>> this.
>>>> <plugin>
>>>>        <artifactId>maven-compiler-plugin</artifactId>
>>>>
>>>>        <executions>
>>>>          <execution>
>>>>
>>>>            <phase>compile</phase>
>>>>            <goals>
>>>>              <goal>compile</goal>
>>>>            </goals>
>>>>            <configuration>
>>>>              <sourceDirectory>wrappers</sourceDirectory>
>>> 
>>> I don't see 'sourceDirectory' as a configuration element for the compile
>>> goal:
>>> http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html
>>> 
>>> It's actually a child element of <build>:
>>> http://maven.apache.org/ref/2.0.4/maven-model/maven.html
>>> 
>>> In general, each module can have only one sourceDirectory and one
>>> testSourceDirectory.
>>> 
>>> What are you trying to do?
>>> 
>>> -- 
>>> Wendy
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-Compiler-plugin-tf2958588s177.html#a8292760
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: Maven Compiler plugin

Posted by franz see <fr...@gmail.com>.
Good day to you, Raju,

I agree with Dawn. It is most likely a simple compilation error on your java
files ( and you probably used -X or --debug which would explain why that
stacktrace was shown. note: your code did not throw the exception, maven did
). Check the output logs on your console again, you will see the compilation
error.

Furthermore, AFAIK, using a non-existing parameter under the plugin's
configuration tag will not produce any error. But it will not warn you of
such as well. 

Anyway, just check the output log in your console again and you would most
probably see there the compilation error on your java files.

Cheers,
Franz


raju wrote:
> 
> Hi Wendy,
> 
> I just wanted to compile some java files in a source folder and move
> compiled files to some destination directory.I have put this under build
> section of pom file only.I gave <sourcedirectory>just after <build>
> element.It says compiling n number of files then throws this compilation
> error.
> 
> Regards
> Raju
> 
> 
> 
> Wendy Smoak-3 wrote:
>> 
>> On 1/11/07, raju <ra...@hotmail.com> wrote:
>>>
>>> Hi,
>>> I am trying to compile files in a folder and move them to a directory.
>>> It
>>> gives the following error:
>>> Diagnosis: Compilation failure
>>> FATAL ERROR: Error executing Maven for a project
>>> org.apache.maven.BuildFailureException: Compilation failure
>>>         at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
>>> Read a lot of similar messages but am not clear what exactly causes
>>> this.
>>> <plugin>
>>>        <artifactId>maven-compiler-plugin</artifactId>
>>>
>>>        <executions>
>>>          <execution>
>>>
>>>            <phase>compile</phase>
>>>            <goals>
>>>              <goal>compile</goal>
>>>            </goals>
>>>            <configuration>
>>>              <sourceDirectory>wrappers</sourceDirectory>
>> 
>> I don't see 'sourceDirectory' as a configuration element for the compile
>> goal:
>> http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html
>> 
>> It's actually a child element of <build>:
>> http://maven.apache.org/ref/2.0.4/maven-model/maven.html
>> 
>> In general, each module can have only one sourceDirectory and one
>> testSourceDirectory.
>> 
>> What are you trying to do?
>> 
>> -- 
>> Wendy
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-Compiler-plugin-tf2958588s177.html#a8292739
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: Maven Compiler plugin

Posted by raju <ra...@hotmail.com>.
Hi Wendy,

I just wanted to compile some java files in a source folder and move
compiled files to some destination directory.I have put this under build
section of pom file only.I gave <sourcedirectory>just after <build>
element.It says compiling n number of files then throws this compilation
error.

Regards
Raju



Wendy Smoak-3 wrote:
> 
> On 1/11/07, raju <ra...@hotmail.com> wrote:
>>
>> Hi,
>> I am trying to compile files in a folder and move them to a directory. It
>> gives the following error:
>> Diagnosis: Compilation failure
>> FATAL ERROR: Error executing Maven for a project
>> org.apache.maven.BuildFailureException: Compilation failure
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
>> Read a lot of similar messages but am not clear what exactly causes this.
>> <plugin>
>>        <artifactId>maven-compiler-plugin</artifactId>
>>
>>        <executions>
>>          <execution>
>>
>>            <phase>compile</phase>
>>            <goals>
>>              <goal>compile</goal>
>>            </goals>
>>            <configuration>
>>              <sourceDirectory>wrappers</sourceDirectory>
> 
> I don't see 'sourceDirectory' as a configuration element for the compile
> goal:
> http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html
> 
> It's actually a child element of <build>:
> http://maven.apache.org/ref/2.0.4/maven-model/maven.html
> 
> In general, each module can have only one sourceDirectory and one
> testSourceDirectory.
> 
> What are you trying to do?
> 
> -- 
> Wendy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-Compiler-plugin-tf2958588s177.html#a8292724
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: Maven Compiler plugin

Posted by Wendy Smoak <ws...@gmail.com>.
On 1/11/07, raju <ra...@hotmail.com> wrote:
>
> Hi,
> I am trying to compile files in a folder and move them to a directory. It
> gives the following error:
> Diagnosis: Compilation failure
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.BuildFailureException: Compilation failure
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
> Read a lot of similar messages but am not clear what exactly causes this.
> <plugin>
>        <artifactId>maven-compiler-plugin</artifactId>
>
>        <executions>
>          <execution>
>
>            <phase>compile</phase>
>            <goals>
>              <goal>compile</goal>
>            </goals>
>            <configuration>
>              <sourceDirectory>wrappers</sourceDirectory>

I don't see 'sourceDirectory' as a configuration element for the compile goal:
http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html

It's actually a child element of <build>:
http://maven.apache.org/ref/2.0.4/maven-model/maven.html

In general, each module can have only one sourceDirectory and one
testSourceDirectory.

What are you trying to do?

-- 
Wendy

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