You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Philippe Faes <Ph...@elis.UGent.be> on 2006/10/04 09:41:16 UTC
change default compileSourceRoots
Dear all,
I'm working on a Maven plug-in that compiles VHDL code.My plug-in would
introduce a new packaging (say "hdl"). I would like to use the maven
compileSourceRoots and testCompileSourceRoots, but their default values
should be changed to "src/main/vhdl" and "src/test/vhdl".
I know this is easily done in the POM of a project, but I would like to
set these defaults of all projects with "hdl" packaging at once, while
still allowing individual "hdl" projects to override my default.
Is there an elegant way to do this?
thanks
--
ir. Philippe Faes
Ghent University - Department ELIS
Sint-Pietersnieuwstraat 41 -- B-9000 Gent
Tel:+32 9 264 95 25 - Fax:+32 9 264 35 94
http://www.elis.UGent.be/~pfaes
ON5DEU -- LPIC1 -- gpg-key:173720B6
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: change default compileSourceRoots
Posted by Shane Isbell <sh...@gmail.com>.
A third option is to inject MavenProject in you pom and then use methods:
MavenProject.getBuild().set[get]SourceDirectory("") and
MavenProject.getBuild().set[get]TestSourceDirectory("");
Shane
On 10/4/06, Philippe Faes <Ph...@elis.ugent.be> wrote:
>
> On Wed, 2006-10-04 at 09:54 +0200, Kenney Westerhof wrote:
> > Hmm, I don't think so - even the native-maven-plugin that can compile
> C/C++ etc.
> > requires new sourceroots.
> >
> > Two options:
> >
> > 1) Just let your VHDL compiler compile stuff from src/(main|test)/vhdl
> > by default, and let users override that using the plugin configuration.
> > Java sources from src/(main|test)/java are also still compiled, but
> you'll just leave
> > that empty. This is basically the same as any other plugin handles
> custom extra
> > source files. (Quick question: to what format do you compile VHDL?
> Native bytecode
> > or Java bytecode?)
> >
> > 2) define a lifecycle.xml for your hdl packaging (which you probably
> already do),
> > and bind a mojo to one of the first lifecycle phases, that replaces the
> default
> > compileSourceRoots. Might work, but it's a bit of a hack.
> >
> > I think we might need a general solution for this. There's some work
> going on wrt.
> > tooling (defining compilers etc..), it could also be used to specify the
> project's language
> > and default source locations. But if this approach is taken you'll
> probably have to wait for maven 2.2
> > to use it..
> >
> > Anyone else got some ideas?
> >
> > -- Kenney
>
> Thanks Kenney,
>
> I'll probably stick with the second option. I need the
> compileSourceRoots later so that I can package sources using the
> maven-source-plugin. I was just hoping some magical sequence in
> components.xml would do the trick.
>
> I'm compiling to native binaries. However, I don't deploy native
> binaries for reuse; I just deploy the source code for reuse in other
> projects. Compiling to Java bytecode would be much cooler, but I don't
> think there exists a compile for that. Deploying native code is just one
> big mess. I try to avoid it.
>
>
> --
> ir. Philippe Faes
> Ghent University - Department ELIS
> Sint-Pietersnieuwstraat 41 -- B-9000 Gent
> Tel:+32 9 264 95 25 - Fax:+32 9 264 35 94
> http://www.elis.UGent.be/~pfaes
> ON5DEU -- LPIC1 -- gpg-key:173720B6
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: change default compileSourceRoots
Posted by Philippe Faes <Ph...@elis.UGent.be>.
On Wed, 2006-10-04 at 09:54 +0200, Kenney Westerhof wrote:
> Hmm, I don't think so - even the native-maven-plugin that can compile C/C++ etc.
> requires new sourceroots.
>
> Two options:
>
> 1) Just let your VHDL compiler compile stuff from src/(main|test)/vhdl
> by default, and let users override that using the plugin configuration.
> Java sources from src/(main|test)/java are also still compiled, but you'll just leave
> that empty. This is basically the same as any other plugin handles custom extra
> source files. (Quick question: to what format do you compile VHDL? Native bytecode
> or Java bytecode?)
>
> 2) define a lifecycle.xml for your hdl packaging (which you probably already do),
> and bind a mojo to one of the first lifecycle phases, that replaces the default
> compileSourceRoots. Might work, but it's a bit of a hack.
>
> I think we might need a general solution for this. There's some work going on wrt.
> tooling (defining compilers etc..), it could also be used to specify the project's language
> and default source locations. But if this approach is taken you'll probably have to wait for maven 2.2
> to use it..
>
> Anyone else got some ideas?
>
> -- Kenney
Thanks Kenney,
I'll probably stick with the second option. I need the
compileSourceRoots later so that I can package sources using the
maven-source-plugin. I was just hoping some magical sequence in
components.xml would do the trick.
I'm compiling to native binaries. However, I don't deploy native
binaries for reuse; I just deploy the source code for reuse in other
projects. Compiling to Java bytecode would be much cooler, but I don't
think there exists a compile for that. Deploying native code is just one
big mess. I try to avoid it.
--
ir. Philippe Faes
Ghent University - Department ELIS
Sint-Pietersnieuwstraat 41 -- B-9000 Gent
Tel:+32 9 264 95 25 - Fax:+32 9 264 35 94
http://www.elis.UGent.be/~pfaes
ON5DEU -- LPIC1 -- gpg-key:173720B6
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: change default compileSourceRoots
Posted by Kenney Westerhof <ke...@apache.org>.
Philippe Faes wrote:
> Dear all,
>
> I'm working on a Maven plug-in that compiles VHDL code.My plug-in would
> introduce a new packaging (say "hdl"). I would like to use the maven
> compileSourceRoots and testCompileSourceRoots, but their default values
> should be changed to "src/main/vhdl" and "src/test/vhdl".
>
> I know this is easily done in the POM of a project, but I would like to
> set these defaults of all projects with "hdl" packaging at once, while
> still allowing individual "hdl" projects to override my default.
> Is there an elegant way to do this?
Hmm, I don't think so - even the native-maven-plugin that can compile C/C++ etc.
requires new sourceroots.
Two options:
1) Just let your VHDL compiler compile stuff from src/(main|test)/vhdl
by default, and let users override that using the plugin configuration.
Java sources from src/(main|test)/java are also still compiled, but you'll just leave
that empty. This is basically the same as any other plugin handles custom extra
source files. (Quick question: to what format do you compile VHDL? Native bytecode
or Java bytecode?)
2) define a lifecycle.xml for your hdl packaging (which you probably already do),
and bind a mojo to one of the first lifecycle phases, that replaces the default
compileSourceRoots. Might work, but it's a bit of a hack.
I think we might need a general solution for this. There's some work going on wrt.
tooling (defining compilers etc..), it could also be used to specify the project's language
and default source locations. But if this approach is taken you'll probably have to wait for maven 2.2
to use it..
Anyone else got some ideas?
-- Kenney
>
> thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org