I want to combine maven goals in Jenkins

558 views
Skip to first unread message

ldriver

unread,
Oct 4, 2016, 1:34:47 PM10/4/16
to Hippo Community
I am setting up a Jenkins job to build our project, we have replication set up and working, I have pre-task, and build task and a post-build task:

pre-task: mvn clean verify

build task: mvn install -Preplication-source

post build task: mvn install -Pdist


What we're going to do is:  use Git for source control, then use Jenkins to build the source and target.

Question:
Do I need to do the mvn clean verify at all?
How can I combine the 2nd and 3rd?
Will I need to run Jenkins twice, one for source and target?

Ultimate goal is to use Jenkins to build the project and deploy to tomcat on both the source AND the target.



Arent-Jan Banck

unread,
Oct 6, 2016, 4:41:37 AM10/6/16
to Hippo Community
Hi,
You don't need both verify and install, 'mvn clean install -Preplication-source' should be enough as 'install' also includes the verify phase, see [1]
You can also clean the workspace with the Jenkins Git plugin 'Clean after checkout' additional behaviour.

It depends a bit on your project layout but likely you can do this all in one Jenkins job. If you have both projects in one repository either make a Maven project in the root folder that handles both, alternatively in Jenkins you can run maven in a subfolder by setting POM (advanced option) to subfolder/pom.xml

Hope this helps.
Regards,
- AJ


--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages