You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wojciech Biela <il...@gmail.com> on 2006/08/21 16:35:39 UTC

have to manually build each submodule?

Hi

I think I'm missing something, I hope I'm missing something, otherwise
this is a great joke ..

When I have a project and multiple subprojects depending on eachother.
I update all of them and then when I build the master project, each
submodule crashes because it's dependencies are not up to date. I have
to go and manually "mvn install" each submodule that had changed and
only then I can properly build the whole thing from the master module
.... how can I make this more usable ???

the problem gets more irritating when I have the whole system under
eclipse and after update all submodules (as eclipse projects) light up
red ....

-- 
Wojtek Biela

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


Re: have to manually build each submodule?

Posted by Arnaud Bailly <ab...@oqube.com>.
Hello,

"Wojciech Biela" <il...@gmail.com> writes:
>
> Well, I definitely have something wrong. I thought it though and I
> think my problem is different. My pom is quite complicated, as is my
> building process. In the master project I use the
> dependency-maven-plugin to add binary builds of the submodules to some
> custom structure:
>
>      <plugin>
>        <groupId>org.codehaus.mojo</groupId>
>        <artifactId>dependency-maven-plugin</artifactId>
>        <executions>
>          <execution>
>            <id>copy</id>
>            <phase>package</phase>
>            <goals>
>              <goal>copy</goal>
>            </goals>
>            <configuration>
>              <artifactItems>
>                <artifactItem>
>                  <groupId>${project.groupId}</groupId>
>                  <artifactId>SubModule1</artifactId>
>                  <version>${project.version}</version>
>                  <type>mod</type>
>                  <outputDirectory>${mod-dir}</outputDirectory>
>                </artifactItem>
>              </artifactItems>
>               .....
>
> The problem is that this is executed BEFORE the submodules are
> built,

That's normal: maven builds parent before children. Your problem may
appear to be better handled by the maven-assembly-plugin which can
aggregate various parts rof a project's modules. Or you may want to
call your plugin outside base build:

$> mvn package
$> mvn dependency:copy  // sure this is wrong but get the idea

regards
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


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


Re: have to manually build each submodule?

Posted by Wojciech Biela <il...@gmail.com>.
Denis! Thank you very much for your help... I just couldn't get out of
the corner ...

> You are definitly missing something :)

good :)

> For the eclipse part, you should run eclipse:eclipse from the root project
> to use project dependency instead of binary dependency (ie a module will
> directly use another module as its dependency instead of using the produced
> jar).

hmmm OK, I was using the eclipse plugin from
http://m2eclipse.codehaus.org, and the dependencies were set that way
(binary) by the "Maven2/Update Source Folders" option from the project
context menu. I like the plugin as it lets me run mvn from the context
menu, it executes a build whenever I modify the pom. So the way to go
right now would be to eclipse:eclipse the main module, and then NOT to
use the plugins "Maven2/Update Source Folders" option but manually add
things to pom, and then eclipse:eclipse again? I found something about
a marriage of those two http://jira.codehaus.org/browse/MECLIPSE-78
but I don't know if it's still valid, or maybe there is another way to
get those two working together?

hmm???

> For the reactor part (the building of the parent project), you certainly
> have something wrong with your projects. Are all the version numbers up to
> date? Do you have any cyclic dependencies?

Well, I definitely have something wrong. I thought it though and I
think my problem is different. My pom is quite complicated, as is my
building process. In the master project I use the
dependency-maven-plugin to add binary builds of the submodules to some
custom structure:

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>dependency-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>copy</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>SubModule1</artifactId>
                  <version>${project.version}</version>
                  <type>mod</type>
                  <outputDirectory>${mod-dir}</outputDirectory>
                </artifactItem>
              </artifactItems>
               .....

The problem is that this is executed BEFORE the submodules are built,
so I get their previous version from the repo, and then they get built
and installed, this is really irritating is the submodule is not yet
installed, then the whole build crashes because the reactor first
builds the master project (so it runs this plugin) and afterwards the
submodules get built.

> If you really can't have it work, fill in a JIRA issue, but this *should*
> work. (and in my case, it is working, as in most cases).
I believe it should work in my case too..

best regards

-- 
Wojtek Biela

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


Re: have to manually build each submodule?

Posted by Denis Cabasson <de...@insee.fr>.
You are definitly missing something :)

For the eclipse part, you should run eclipse:eclipse from the root project
to use project dependency instead of binary dependency (ie a module will
directly use another module as its dependency instead of using the produced
jar).

For the reactor part (the building of the parent project), you certainly
have something wrong with your projects. Are all the version numbers up to
date? Do you have any cyclic dependencies? 

If you really can't have it work, fill in a JIRA issue, but this *should*
work. (and in my case, it is working, as in most cases).

Denis.

Wojciech Biela wrote:
> 
> Hi
> 
> I think I'm missing something, I hope I'm missing something, otherwise
> this is a great joke ..
> 
> When I have a project and multiple subprojects depending on eachother.
> I update all of them and then when I build the master project, each
> submodule crashes because it's dependencies are not up to date. I have
> to go and manually "mvn install" each submodule that had changed and
> only then I can properly build the whole thing from the master module
> .... how can I make this more usable ???
> 
> the problem gets more irritating when I have the whole system under
> eclipse and after update all submodules (as eclipse projects) light up
> red ....
> 
> -- 
> Wojtek Biela
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/have-to-manually-build-each-submodule--tf2140589.html#a5908698
Sent from the Maven - Users forum at Nabble.com.


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