开发者

Different cargo.run profiles in maven2 (Java / Hippo)

开发者 https://www.devze.com 2023-04-12 23:18 出处:网络
I\'m trying to setup our build/deploy process for a project that uses Hippo, a Java / JCR CMS. The deployment strategy we want to achieve is:

I'm trying to setup our build/deploy process for a project that uses Hippo, a Java / JCR CMS. The deployment strategy we want to achieve is:

  1. Local development: use the default 'in memory' database provided with Hippo.

  2. Test and production environments: use MySQL.

I've successfully followed the instructions for setting Hippo up to use MySQL and now I'm trying to configure the maven2 pom.xml so we can have different deployments - one called from the IDE/command line by a developer and one called by Jenkins. So I read up on the cargo maven2 plugin used by Hippo, and tried to create a new profile called cargo.run.mysql - however, when I run maven with mvn -P cargo.run.mysql, cargo does not start the container (Tomcat), it builds instead. After some more reading on the cargo plugin page, I'm guessing (could be wrong!) that there's some kind of magic link between a maven profile ID and a cargo 'target' / 'execution mode' (in this case cargo.run -> cargo:run). So now I'm stuck trying to get my new target with its different configuration file copy tasks to run.

Does anyone have experience with this? Advice on how to do this sensibly is also very welcome! I'm used to using ant and its more low-level approach, and I have to admit ma开发者_如何学编程ven is really making me scratch my head a lot.


The magic part that you might be missing is that the profile is defined multiple times in the pom.xml hierarchy. The part that you might be missing is all the way up in the hippo-cms7-project pom.

See http://svn.onehippo.org/repos/hippo/hippo-cms7/project/tags/hippo-cms7-project-8/pom.xml

Do I understand it correctly that you are trying to run your project from Jenkins? Have you noticed that you could also create a distribution by using the maven -Pdist profile? That way it will create a distribution from your project that you might deploy to a remote server.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号