Good day to you, Martin M,

May I ask you to repost this again. It seems as though your message have
been made into one long line which makes it hard to read.

Thanks,
Franz


Martin M wrote:
> 
> Hi all,
> 
> I implemented a custom compiler-plugin. Now I'd like to pass some
> parameters to it, but I don't get it working. My plugin always tells me
> that the parameters have null-value. I assume it's possible to pass
> parameters to a compiler-plugin, isn't it.
> 
> The plugin-code looks like this:
> 
> 
> /**
>  * custom compiler 
>  *
>  * @version $Id$
>  * @goal compile
>  * @phase compile
>  * @requiresDependencyResolution compile
>  */
> 
> public class javamake extends AbstractMojo
> {
> 
>     /**
>      * @parameter 
>      **/
>     private String testParam
> 
>     public void execute() throws MojoExecutionException
>     {
>         getLog().info("Start compiling, ... with " + testParam);
>      }
> 
> 
> I'm calling the plugin in my pom.xml like this:
> 
> 
> 
>           <plugin>
>            <artifactId>maven-compiler-plugin</artifactId>
>            <configuration>
>            <testParam>c1</testParam>
>            </configuration>
> 
>            <dependencies>
>            <dependency>
>            <groupId>mygroup</groupId>
>            <artifactId>customCompile</artifactId>
>            <version>1.0-SNAPSHOT</version>
>            </dependency>
>            </dependencies>
>           </plugin>
> 
> 
> 
> Ihave also replaced the standard-compiler in maven's components.xml to get
> my compiler activated.
> 
> 
>    <component>
>       <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
>       <role-hint>jar</role-hint>
>      
> <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
> </implementation>
>       <configuration>
>         <lifecycles>
>           <lifecycle>
>             <id>default</id>
>             <!-- START SNIPPET: jar-lifecycle -->
>             <phases>
>              
> <process-resources>org.apache.maven.plugins:maven-resources-plugin
> :resources</process-resources>
>              
> <compile>mygroup:customCompile:1.0-SNAPSHOT:compile</compile>
>                etc.
> 
> 
> Does anyone have a hint, how I could pass my custom parameter?
> 
> Thanks in advance!
> 
> Regards,
> Martin
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/passing-custom-parameters-to-a-custom-compiler-plugin-tf2958426s177.html#a8278077
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to