You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rahul Thakur <ra...@gmail.com> on 2009/03/12 16:35:33 UTC

ToolChain, MavenSession and maven-compiler-plugin

Greetings,

Has anyone used maven-compiler-plugin to invoke Annotation processor on 
Java sources?

I have a use case where I need to invoke an annotation processor via the 
maven-compiler-plugin. I need to pass in an option to the processor 
(done using -A option on 'javac' or 'apt'), but it appears that I can't 
just use <compilerArguments>.

I decided to look up test cases in maven-compiler-plugin sources hoping 
to find an example there, but none. So I started to put together a unit 
test for annotation processor invocation.

The issue that I am running into currently is obtaining a Toolchain 
instance in a test case, which appears to be due to the absence of a 
MavenSession handle where running a Mojo unit test.

Can anyone share if its possible to workaround this limitation?

Thanks in advance,

Rahul



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


RE: ToolChain, MavenSession and maven-compiler-plugin

Posted by Henric Larsson <He...@igindex.co.uk>.
I've run into this problem too, worked around it by using the
maven-antrun-plugin, and invoke an ant script.



-----Original Message-----
From: Rahul Thakur [mailto:rahul.thakur.xdev@gmail.com] 
Sent: 12 March 2009 15:36
To: Maven Users List
Subject: ToolChain, MavenSession and maven-compiler-plugin

Greetings,

Has anyone used maven-compiler-plugin to invoke Annotation processor on 
Java sources?

I have a use case where I need to invoke an annotation processor via the

maven-compiler-plugin. I need to pass in an option to the processor 
(done using -A option on 'javac' or 'apt'), but it appears that I can't 
just use <compilerArguments>.

I decided to look up test cases in maven-compiler-plugin sources hoping 
to find an example there, but none. So I started to put together a unit 
test for annotation processor invocation.

The issue that I am running into currently is obtaining a Toolchain 
instance in a test case, which appears to be due to the absence of a 
MavenSession handle where running a Mojo unit test.

Can anyone share if its possible to workaround this limitation?

Thanks in advance,

Rahul



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

The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Index plc is a company registered in England and Wales under number 01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the Financial Services Authority. FSA Register number 114059.

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