You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Priess <di...@googlemail.com> on 2013/12/13 13:24:14 UTC
Multi-modules projects
Hi,
our projects have the following structure:
- parent pom
-- pom.xml
----cpp--pom.xml
----java--pom.xml
To build a project like this we must invoke different build steps. For the
CPP build we like to invoke gcc for the java build we like to invoke javac
and many other steps. In our enviroment we have a lot of builds which are
similar.
Is there a way to define the builds steps in one place to avoid
duplications of the javac and gcc build configuration. I like to inherite
or get the build steps from one central place and use this steps in a multi
module project. Any idea howto resolve this?
Cheerrs,
Michael
Re: Multi-modules projects
Posted by Stephen Connolly <st...@gmail.com>.
<packaging> is your friend
The C++ code should be using a different packaging type, that way it can
bind the plugins that your C++ packaging needs to the corresponding
lifecycle phases and then...
mvn compile
will do just that, irrespective of whether you are in the C++ or the Java
module, and likewise for
mvn test
mvn package
mvn install
mvn deploy
etc
On 13 December 2013 12:24, Michael Priess <di...@googlemail.com>wrote:
> Hi,
>
> our projects have the following structure:
>
> - parent pom
> -- pom.xml
> ----cpp--pom.xml
> ----java--pom.xml
>
> To build a project like this we must invoke different build steps. For the
> CPP build we like to invoke gcc for the java build we like to invoke javac
> and many other steps. In our enviroment we have a lot of builds which are
> similar.
>
> Is there a way to define the builds steps in one place to avoid
> duplications of the javac and gcc build configuration. I like to inherite
> or get the build steps from one central place and use this steps in a multi
> module project. Any idea howto resolve this?
>
> Cheerrs,
>
> Michael
>
Re: Multi-modules projects
Posted by Michael Priess <di...@googlemail.com>.
@Stephan Connolly Thanks for the hint. But can I bind a profile to a self
defined package or could you provide a example project :)
2013/12/13 Christofer Dutz <ch...@c-ware.de>
> I have similar Projects consisting of Java, Flex and .Net artifacts.
> I usually configure the plugins in the root of the maven Project and use
> self-activating maven profiles.
>
> Flex is active if a Directory src/main/flex exists, Npanday is used if i
> have src/main/csharp and so on.
>
> <profile>
> <id>java-project</id>
> <activation>
> <file>
> <exists>src/main/java</exists>
> </file>
> </activation>
> ...
> </profile
> <profile>
> <id>flex-project</id>
> <activation>
> <file>
> <exists>src/main/flex</exists>
> </file>
> </activation>
> ...
> </profile
> <profile>
> <id>csharp-project</id>
> <activation>
> <file>
> <exists>src/main/csharp</exists>
> </file>
> </activation>
> ...
> </profile
>
> Hope this helps.
>
> Chris
>
>
> ________________________________________
> Von: Michael Priess <di...@googlemail.com>
> Gesendet: Freitag, 13. Dezember 2013 13:24
> An: users@maven.apache.org
> Betreff: Multi-modules projects
>
> Hi,
>
> our projects have the following structure:
>
> - parent pom
> -- pom.xml
> ----cpp--pom.xml
> ----java--pom.xml
>
> To build a project like this we must invoke different build steps. For the
> CPP build we like to invoke gcc for the java build we like to invoke javac
> and many other steps. In our enviroment we have a lot of builds which are
> similar.
>
> Is there a way to define the builds steps in one place to avoid
> duplications of the javac and gcc build configuration. I like to inherite
> or get the build steps from one central place and use this steps in a multi
> module project. Any idea howto resolve this?
>
> Cheerrs,
>
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
AW: Multi-modules projects
Posted by Christofer Dutz <ch...@c-ware.de>.
I have similar Projects consisting of Java, Flex and .Net artifacts.
I usually configure the plugins in the root of the maven Project and use self-activating maven profiles.
Flex is active if a Directory src/main/flex exists, Npanday is used if i have src/main/csharp and so on.
<profile>
<id>java-project</id>
<activation>
<file>
<exists>src/main/java</exists>
</file>
</activation>
...
</profile
<profile>
<id>flex-project</id>
<activation>
<file>
<exists>src/main/flex</exists>
</file>
</activation>
...
</profile
<profile>
<id>csharp-project</id>
<activation>
<file>
<exists>src/main/csharp</exists>
</file>
</activation>
...
</profile
Hope this helps.
Chris
________________________________________
Von: Michael Priess <di...@googlemail.com>
Gesendet: Freitag, 13. Dezember 2013 13:24
An: users@maven.apache.org
Betreff: Multi-modules projects
Hi,
our projects have the following structure:
- parent pom
-- pom.xml
----cpp--pom.xml
----java--pom.xml
To build a project like this we must invoke different build steps. For the
CPP build we like to invoke gcc for the java build we like to invoke javac
and many other steps. In our enviroment we have a lot of builds which are
similar.
Is there a way to define the builds steps in one place to avoid
duplications of the javac and gcc build configuration. I like to inherite
or get the build steps from one central place and use this steps in a multi
module project. Any idea howto resolve this?
Cheerrs,
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org