[2.0] Integrating Play 2.0 applications in a Maven-based build process

3,932 views
Skip to first unread message

Clement Escoffier

unread,
Apr 1, 2012, 12:51:01 PM4/1/12
to play-framework
Hi,

I know that Play 2 is promoting SBT, but here it's not the point. We're heavily relying on Maven, and so the question was: how do we integrate Play 2 app in our current build process (Apache Maven, Jenkins, Sonatype Nexus, deployment using Puppet).
So, I've created a play2-maven-plugin to integrate play 2 app within Maven builds. It's pretty simple, and actually don't do much except wrapping play 2 calls. 

It supports dependency management, compilation, test and packaging (relying on dist).


Regards,

Clement



Message has been deleted

johanandren

unread,
Jul 27, 2012, 6:33:28 AM7/27/12
to play-fr...@googlegroups.com
Just out of curiousity, did you feel that it was impossible to use the sbt build of play with jenkins and nexus or was it more of a political (i.e. we have decided to always use maven for every project at any cost) decision?

Clement Escoffier

unread,
Jul 29, 2012, 4:48:28 AM7/29/12
to play-fr...@googlegroups.com
Hi,


Regards,

Clement

On 27.07.2012, at 11:29, Figroc Chen wrote:

Hi Clement, 

I'm pretty new to Play! framework. Could you please make a brief example? 
Thanks a lot.

Regards, 
Figroc
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/DMIGawpE9L8J.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Clement Escoffier

unread,
Jul 29, 2012, 4:57:30 AM7/29/12
to play-fr...@googlegroups.com
Hi,

On 27.07.2012, at 12:33, johanandren wrote:

Just out of curiousity, did you feel that it was impossible to use the sbt build of play with jenkins and nexus or was it more of a political (i.e. we have decided to always use maven for every project at any cost) decision?

There are several reasons for using Maven in my case:

1) my team knew Maven, and don't really have time to learn SBT.
2) the play part is just one part of the system we developed, the rest is using Maven, so being able to build everything in one command was better/simpler/faster.
3) Using Jenkins / Nexus with SBT is possible but require quite some configuration, which was already done with Maven (deployment target, profiles, authentication, unit test / integration tests / deployment tests reports…)
4) The release process  and continuous delivery process are really important points for me. We have hard/strict release process and continuous delivery pipelines. Re-implementing them with SBT for only one part of the system was definitely too costly.

So, in my case, switching to Maven is to reduce the cost. However we still use the Play 'development' mode (hot-reload), but the 'real' build use Maven (executed by Jenkins), and it's the Maven build which is deployed on the staging / prod system. So actually, we have the best of both world).

Regards,

Clement



--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/pHiR_N_XPlsJ.

Figroc Chen

unread,
Jul 29, 2012, 5:48:06 AM7/29/12
to play-fr...@googlegroups.com

Hi,

I have managed the build process using mvn tool with the plugin. But Eclipse complains constantly, saying that it fails on the compile phase and copydependecy phase. (I've posted detailed message in the plugin 1.2.0 announcement thread. I can't access that info right now. Sorry for the inconvenience.)
Could you please give some hints, checklist, or something alike? My configuration is: jdk 1.7, maven 3.0.4, play! 2.0.2, eclipse juno, play2-maven-plugin 1.2.0. Thanks in advance.

Regards,
Figroc

Figroc Chen

unread,
Jul 29, 2012, 11:05:02 PM7/29/12
to play-fr...@googlegroups.com

Hi, 

The post I've mentioned previously has been deleted somehow. I'll repost the detailed error messages here. Please let me know if it's inappropriate.

Plugin execution not covered by lifecycle configuration: de.akquinet.innovation.play2:play2-maven-plugin:1.2.0:compile (execution: default-compile, phase: compile) pom.xml /net.svr.sms line 40 Maven Project Build Lifecycle Mapping Problem
Plugin execution not covered by lifecycle configuration: de.akquinet.innovation.play2:play2-maven-plugin:1.2.0:copy-dependencies (execution: default-copy-dependencies, phase: process-resources) pom.xml /net.svr.sms line 40 Maven Project Build Lifecycle Mapping Problem

From line 40 from the pom.xml is:
<plugins>
    <plugin>
      <groupId>de.akquinet.innovation.play2</groupId>
      <artifactId>play2-maven-plugin</artifactId>
      <version>1.2.0</version>
      <extensions>true</extensions>
    </plugin>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>2.5.1</version>
      <configuration>
        <source>1.7</source>
        <target>1.7</target>
      </configuration>
    </plugin>
</plugins>

BTW, the OS is Windows Server 2008 R2 x64, m2e version is 1.1.0.20120530-0009.

Regards, 
Figroc

On Sunday, July 29, 2012 5:48:06 PM UTC+8, Figroc Chen wrote:

Hi,

I have managed the build process using mvn tool with the plugin. But Eclipse complains constantly, saying that it fails on the compile phase and copydependecy phase. (I've posted detailed message in the plugin 1.2.0 announcement thread. I can't access that info right now. Sorry for the inconvenience.)
Could you please give some hints, checklist, or something alike? My configuration is: jdk 1.7, maven 3.0.4, play! 2.0.2, eclipse juno, play2-maven-plugin 1.2.0. Thanks in advance.

Regards,
Figroc

Clement Escoffier

unread,
Jul 31, 2012, 4:06:01 AM7/31/12
to play-fr...@googlegroups.com
Hi,

Did you try without the maven-compiler-plugin ? The compilation is done by play.

Regards,

Clement

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/L_kkFvc8nZoJ.
Reply all
Reply to author
Forward
0 new messages