maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Thouvenin <romain.thouve...@gmail.com>
Subject Use the eclipse compiler in a maven component
Date Thu, 23 Jun 2011 16:42:20 GMT
Hello,

I am working on a fairly big maven project, and develop in Java with Eclipse.

To save compilation time, I would like that maven and eclipse share
the same target, which I managed to do. However when I compile with
maven, Eclipse lacks some stuff that it puts in the bytecode, so it
recompiles everything (from what I understood).

To solve this, I thought I would ask maven to use the same compiler as eclipse.
After some search on the web, I found out I could add this in the top pom:

<build>
...
<plugins>
...
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>
	<configuration>
		<compilerId>eclipse</compilerId>
		<source>1.5</source>
		<target>1.5</target>
		<optimize>true</optimize>
	</configuration>
	<dependencies>
		<dependency>
			<groupId>org.codehaus.plexus</groupId>
			<artifactId>plexus-compiler-eclipse</artifactId>
			<version>1.8.1</version>
		</dependency>
	</dependencies>
</plugin>
</plugins>
</build>


This seems to work, but the build fails fairly quickly with lots of
errors, while it succeeds with javac.
I'm not sure why, but it seems that there is some conflicts linked to
the fact the failing java files are generated files.

So I thought I could try to use the eclipse compiler only for the
component I am working on (which does not have that kind of generated
files). I added the above snippet in the pom of my component, but when
the build reaches my component, the following error is raised:

No such compiler 'eclipse'

I also tried to add the plexus-compiler-eclipse dependency in the
dependencies listed in the top pom, but same error.


Do you know if what I am trying to do is possible? Any hint of how I can do it?

Sorry if the question seems dumb, I am not a maven expert, and I am
not the one who designed the whole maven architecture of our project.
And sorry for the long message, I wanted to give the whole context...


Thanks a lot for your help!

Romain

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


Mime
View raw message