cescoffier / maven-play2-plugin

A Maven Plugin to build Play2 applications
Apache License 2.0
49 stars 41 forks source link

Add 'install-play' goal that download and install Play! distributions. #21

Closed eskatos closed 12 years ago

eskatos commented 12 years ago

Hello Clement,

Been a while.

This pull request contains a mojo that add an install-play goal. It do not require a project nor dependency resolution. The motivation behind it is continuous integration servers where it can be invoked directly or using maven profiles.

Here is an example on how to use it using a 'ci' profile:

<profiles>
    <profile>
        <!-- Continuous Integration -->
        <id>ci</id>
        <build>
            <plugins>
                <!-- Play2 installation -->
                <plugin>
                    <groupId>de.akquinet.innovation.play2</groupId>
                    <artifactId>play2-maven-plugin</artifactId>
                    <configuration>
                        <play2Home>${user.home}/opt/play-${play2.version}</play2Home>
                    </configuration>
                    <executions>
                        <execution>
                            <id>ci-play-installation</id>
                            <goals>
                                <goal>install-play</goal>
                            </goals>
                            <phase>pre-clean</phase>
                            <configuration>
                                <play2version>${play2.version}</play2version>
                                <play2basedir>${user.home}/opt</play2basedir>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

The mojo download and install play only if it's not already installed.

Tell me what you think.

/Paul

cescoffier commented 12 years ago

Hi,

Looks pretty good. Could you add some documentation about this feature (src/main/site/markdown). The doc should mention that the Maven process must be able to write to the play2basedir location. Moreover, the execution flag must be set on the 'play' command.

eskatos commented 12 years ago

The mojo tries to set the execution bit on play and framework/build if needed and fails if its unable to do so.

cescoffier commented 12 years ago

Thanks !