Hi Chris,
Consider this pom.xml fragment:
<build>
<plugin>
<groupId>org.foo</groupId>
<artifactId>generic-commandline-plugin</artifactId>
<executions>
<execution>
<id>execution-id</id>
<phase>phase-id</phase>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
<configuration>
<executablePath>${foo.home}/bin/foo</executablePath>
<arguments><!CDATA[ insert your args here ]]></arguments>
</configuration>
</plugin>
</build>
Then the generic-commandline-plugin would launch the ${foo.home}/bin/foo
and pass it the arguments string as is.
Wouldn't it be *much* simpler to implement than the current compiler
plugins?
I have downloaded the Maven sources and started to debug the
maven-compiler-plugin. (BTW, the Doodle Project provides a .NET plugin
for M2, but I have not tested it yet)
After one day of debugging (!), I still cannot understand why it is so
complicated to spawn an OS process and pass it arguments!
One example of this over complexity is the
org.codehaus.plexus.compiler.CompilerConfiguration class, which is used
to pass arguments to the javac compiler (of course, it is useless for
other types of compilers).
Another example is the org.apache.maven.plugin.AbstractCompilerMojo
class which checks if there are newer sources to compile and if it finds
such then it invokes the compiler, otherwise it logs "Nothing to compile
- all classes are up to date". Why is this needed? Isn't this the
compiler's job?
What am I missing?
Please comment,
Adrian.
Stevenson, Chris wrote:
> Hi Adrian,
>
> I've had a bit of a play around with custom compilers, if you'd like to look
> at some source on how to do it you can download my CSharp stuff from JIRA:
>
> http://jira.codehaus.org/browse/MOJO-304
>
> The specific bits of interest to you should be;
>
> plugins\csharp-maven-plugin\src\main\resources\META-INF\plexus\components.xm
> l (which makes plexus aware of the compiler)
>
> plugins\sample\maven-sample-csharp_exe\pom.xml (which shows how you to plumb
> the compiler into maven using the maven compiler plugin.
>
> If you have any more issues, please email. I'll try and help.
>
> Chris
>
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Adrian Herscu
> Sent: 23 February 2006 13:38
> To: [email protected]
> Subject: [m2] HOWTO: Compilers
>
> Hi all,
>
> I am trying to understand how compilers are invoked by M2 and eventually how
> to add support for my own compiler.
>
> Please explain how M2 relates to Plexus (in other words why M2 needs
> Plexus?).
>
> Do I need to build my compiler support as a Plexus component?
>
> Is it possible to reuse existing M2 compiler support (i.e. from
> maven-compiler-plugin) for my own compiler? How?
>
> Thanks,
> Adrian.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> --------------------------------------------------------------------------------
> The information contained herein is confidential and is intended solely for
> the
> addressee. Access by any other party is unauthorised without the express
> written permission of the sender. If you are not the intended recipient,
> please
> contact the sender either via the company switchboard on +44 (0)20 7623 8000,
> or
> via e-mail return. If you have received this e-mail in error or wish to read
> our
> e-mail disclaimer statement and monitoring policy, please refer to
> http://www.drkw.com/disc/email/ or contact the sender. 3167
> --------------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]