aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Jenkins incremental build & Maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Jenkins incremental build & Maven " Watch "Jenkins incremental build & Maven " New topic
Author

Jenkins incremental build & Maven

attu baba
Greenhorn

Joined: Dec 20, 2012
Posts: 20
I have the multi module project Module --Modulea,moduleb,modulec... If I change only the moduleb... then i need incremental build to do only moduleb build and the modulea modulec should be the same build before.

Ans: somebody suggested If you check the check-box ( incremental build in jenkins) i recommend it will exactly do this. Can you check if you could do via mvn -pl modulename -amd clean package.

I am trying to run it through Maven. mvn -pl -amd module clean package ( module here is my module name)

C:\prototype>mvn -pl Mymodulename -amd clean package [INFO] Scanning for projects... [ERROR] Could not find the selected project in the reactor: Mymodulename -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] cwiki.apache.org/confluence/display/MAVEN..

The prototype folder has my root pom. I run my builds through profiles ( I run a single command mvn install -Pl-- profile name of my child pom) ( if i run this command all modules like A,B,C are built).

My question is do i have to separate the profiles for A,B AND C.

Please advise.
attu baba
Greenhorn

Joined: Dec 20, 2012
Posts: 20
hi,

Any thoughts for these proceses.
Bruno Candido Volpato da Cunha
Greenhorn

Joined: Feb 21, 2012
Posts: 18

Hello.

Your question wasn't so clear to me...

Can you attach your pom.xml files?



Thank you.

Bruno Candido Volpato da Cunha
Oracle Certified Java Programmer 6
attu baba
Greenhorn

Joined: Dec 20, 2012
Posts: 20
Hello

Thanks for your reply. Here is my question. I am trying to use maven reactor. I am trying to refer to this website http://blog.akquinet.de/2010/05/26/mastering-the-maven-command-line-%E2%80%93-reactor-options/.

I have parent poms which build all the parent projects ( i mean all modules). Then we have to build child modules.

I am attaching my parent root pom. I use mvn clean install -Pbuild-parent-poms then mvn clean install -Pbuild-projects ( these are the things for the full build).

Now I am trying to use this concept http://blog.akquinet.de/2010/05/26/mastering-the-maven-command-line-%E2%80%93-reactor-options/., But its not working and throwing

I am getting this error. The protype has my rootpom.

Can you check if you could do via mvn -pl -amd module clean package – khmarbaise yesterday

C:\prototype>mvn -pl Mymodulename -amd clean package [INFO] Scanning for projects... [ERROR] Could not find the selected project in the reactor: Mymodulename -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] cwiki.apache.org/confluence/display/MAVEN/… – attu yesterday .

Thanks
Bruno Candido Volpato da Cunha
Greenhorn

Joined: Feb 21, 2012
Posts: 18

I guess you forgot the attachment.


Regards,
Bruno
attu baba
Greenhorn

Joined: Dec 20, 2012
Posts: 20
Hi

Sorry . Here is the attachment.

attu baba
Greenhorn

Joined: Dec 20, 2012
Posts: 20
Hi,

Here is the attachment.

<profiles>
- <profile>
<id>build-parent-poms</id>
- <properties>
<build-parent-poms>true</build-parent-poms>
</properties>
- <modules>
<module>A</module>
<module>M</module>
<module>F</module>
</modules>
</profile>
- <profile>
<id>build-this-pom</id>
</profile>
- <profile>
<id>build-projects</id>
- <properties>
<build-projects>true</build-projects>
</properties>
- <modules>
<module>M</module>
<module>F</module>
<module>Build</module>
</modules>
</profile>
</profiles>
attu baba
Greenhorn

Joined: Dec 20, 2012
Posts: 20
I am not able to attach the whole POM in the attachment. Please provide me any other alternative.

Thanks
attu baba
Greenhorn

Joined: Dec 20, 2012
Posts: 20
Please advise me about any further process.
Bruno Candido Volpato da Cunha
Greenhorn

Joined: Feb 21, 2012
Posts: 18

If you need to build your 3 modules (entire project), why you can't build your parent project?

Just with mvn clean package


Please, clarify if to me.
attu baba
Greenhorn

Joined: Dec 20, 2012
Posts: 20
Hi,

No you must have misunderstood the point. From the parent POM i need to build a single module but I am not able to make it. I am trying to refer to this webite.

http://blog.akquinet.de/2010/05/26/mastering-the-maven-command-line-%E2%80%93-reactor-options/

In this lets suppose we do full build first it will make A,B,C modules. If the changes are made only in B module then the other build should only just change B the A and C should not be built again. I think that what reactor shows, but if there are dependencies then it will make its dependent modules.

Please advise
Bruno Candido Volpato da Cunha
Greenhorn

Joined: Feb 21, 2012
Posts: 18

Oh, sorry...

But don't you have a directory/POM for each module?
Go to the directory and try to do the Maven "clean package" command.

attu baba
Greenhorn

Joined: Dec 20, 2012
Posts: 20
Hi,

I mean how to use the maven reactors. Please advise me.

Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

You could define various profiles, with each profile building only one of the child projects, and an "activeByDefault" profile that builds everything. Then specify the profile you want on the command line.

Another possibility is to not use Maven's master/submodule hierarchy. Instead have each submodule be its own project, and if the master module also builds something have it be its own project (with the former submodules being defined as dependencies.) Then in Jenkins set up the builds such that if any of the former submodules get built then the former master module gets built also.


JBoss In Action
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Jenkins incremental build & Maven