You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Craig McDaniel <cp...@gmail.com> on 2006/05/26 20:24:26 UTC

m2 Plugin Dev: Adding Source Directories to the Compiler

OK, so I have discovered the "compilerSourceRoots" property of the
compiler plugin. I was wondering if there is a standard way to do this
from within my Mojo, so I don't have to add a <plugin> configuration
for the compiler plugin in my POM.

-- 
Craig McDaniel

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


Re: m2 Plugin Dev: Adding Source Directories to the Compiler

Posted by Wayne Fay <wa...@gmail.com>.
Is it just me, or did this entire email thread consist of one person
emailing his questions and thoughts to the group repeatedly, until he
ended up solving it himself? Not complaining, just making sure I
didn't miss something... ;-)

Wayne

On 5/26/06, Craig McDaniel <cp...@gmail.com> wrote:
> Thanks! You've been so helpful!
>
> On 5/26/06, Craig McDaniel <cp...@gmail.com> wrote:
> > Try this:
> >
> >     /**
> >      * @parameter expression="${project.compileSourceRoots}"
> >      */
> >     private List compileSourceRoots;
> >
> > ......
> >
> >     compileSourceRoots.add(outputDir.getAbsolutePath());
> >
> >
> > On 5/26/06, Craig McDaniel <cp...@gmail.com> wrote:
> > > Well, compilerSourceRoots seems to be read only:
> > >
> > > [ERROR] BUILD ERROR
> > > [INFO] ------------------------------------------------------------------------
> > > [INFO] Error configuring:
> > > org.apache.maven.plugins:maven-compiler-plugin. Reason: ERROR: Cannot
> > > override read-only parameter: compileSourceRoots in goal:
> > > compiler:compile
> > > [INFO] ------------------------------------------------------------------------
> > >
> > > So how do I get my generated sources to compile?
> > >
> > > On 5/26/06, Craig McDaniel <cp...@gmail.com> wrote:
> > > > OK, so I have discovered the "compilerSourceRoots" property of the
> > > > compiler plugin. I was wondering if there is a standard way to do this
> > > > from within my Mojo, so I don't have to add a <plugin> configuration
> > > > for the compiler plugin in my POM.
> > > >
> > > > --
> > > > Craig McDaniel
> > > >
> > >
> > >
> > > --
> > > Craig McDaniel
> > >
> >
> >
> > --
> > Craig McDaniel
> >
>
>
> --
> Craig McDaniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: m2 Plugin Dev: Adding Source Directories to the Compiler

Posted by Craig McDaniel <cp...@gmail.com>.
Thanks! You've been so helpful!

On 5/26/06, Craig McDaniel <cp...@gmail.com> wrote:
> Try this:
>
>     /**
>      * @parameter expression="${project.compileSourceRoots}"
>      */
>     private List compileSourceRoots;
>
> ......
>
>     compileSourceRoots.add(outputDir.getAbsolutePath());
>
>
> On 5/26/06, Craig McDaniel <cp...@gmail.com> wrote:
> > Well, compilerSourceRoots seems to be read only:
> >
> > [ERROR] BUILD ERROR
> > [INFO] ------------------------------------------------------------------------
> > [INFO] Error configuring:
> > org.apache.maven.plugins:maven-compiler-plugin. Reason: ERROR: Cannot
> > override read-only parameter: compileSourceRoots in goal:
> > compiler:compile
> > [INFO] ------------------------------------------------------------------------
> >
> > So how do I get my generated sources to compile?
> >
> > On 5/26/06, Craig McDaniel <cp...@gmail.com> wrote:
> > > OK, so I have discovered the "compilerSourceRoots" property of the
> > > compiler plugin. I was wondering if there is a standard way to do this
> > > from within my Mojo, so I don't have to add a <plugin> configuration
> > > for the compiler plugin in my POM.
> > >
> > > --
> > > Craig McDaniel
> > >
> >
> >
> > --
> > Craig McDaniel
> >
>
>
> --
> Craig McDaniel
>


-- 
Craig McDaniel

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


Re: m2 Plugin Dev: Adding Source Directories to the Compiler

Posted by Craig McDaniel <cp...@gmail.com>.
Try this:

    /**
     * @parameter expression="${project.compileSourceRoots}"
     */
    private List compileSourceRoots;

......

    compileSourceRoots.add(outputDir.getAbsolutePath());


On 5/26/06, Craig McDaniel <cp...@gmail.com> wrote:
> Well, compilerSourceRoots seems to be read only:
>
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error configuring:
> org.apache.maven.plugins:maven-compiler-plugin. Reason: ERROR: Cannot
> override read-only parameter: compileSourceRoots in goal:
> compiler:compile
> [INFO] ------------------------------------------------------------------------
>
> So how do I get my generated sources to compile?
>
> On 5/26/06, Craig McDaniel <cp...@gmail.com> wrote:
> > OK, so I have discovered the "compilerSourceRoots" property of the
> > compiler plugin. I was wondering if there is a standard way to do this
> > from within my Mojo, so I don't have to add a <plugin> configuration
> > for the compiler plugin in my POM.
> >
> > --
> > Craig McDaniel
> >
>
>
> --
> Craig McDaniel
>


-- 
Craig McDaniel

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


Re: m2 Plugin Dev: Adding Source Directories to the Compiler

Posted by Craig McDaniel <cp...@gmail.com>.
Well, compilerSourceRoots seems to be read only:

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error configuring:
org.apache.maven.plugins:maven-compiler-plugin. Reason: ERROR: Cannot
override read-only parameter: compileSourceRoots in goal:
compiler:compile
[INFO] ------------------------------------------------------------------------

So how do I get my generated sources to compile?

On 5/26/06, Craig McDaniel <cp...@gmail.com> wrote:
> OK, so I have discovered the "compilerSourceRoots" property of the
> compiler plugin. I was wondering if there is a standard way to do this
> from within my Mojo, so I don't have to add a <plugin> configuration
> for the compiler plugin in my POM.
>
> --
> Craig McDaniel
>


-- 
Craig McDaniel

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