wouterhardeman / play2-maven-plugin

Automatically exported from code.google.com/p/play2-maven-plugin
0 stars 0 forks source link

Out of memory when compiling play project #42

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.compiling a quite big projet 
2.
3.

HI,

when i test to compile and war package little project it is ok when i test with 
a real project i have a out of memory.. how i can do ?

play version 2.2.4 scala version 2.10.0 or 2.10.2

Regards

<packaging>play2</packaging>

    <properties>
        <persistent.unit.name>#jpa.default=defaultPersistenceUnit</persistent.unit.name>
        <application.global>#application.global=controllers.Global</application.global>
        <application.name>hackaton</application.name>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <play2.version>2.2.4</play2.version>
        <scala.version>2.10.2</scala.version>

        <play2.plugin.version>1.0.0-alpha7</play2.plugin.version>
        <sbt-compiler.plugin.version>1.0.0-beta4</sbt-compiler.plugin.version>
    </properties>

    <repositories>
        <repository>
            <id>typesafe</id>
            <url>http://repo.typesafe.com/typesafe/releases/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.github.play2war.ext</groupId>
            <artifactId>redirect-playlogger_2.10</artifactId>
            <version>1.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.github.play2war</groupId>
            <artifactId>play2-war-core-servlet30_2.10</artifactId>
            <version>1.2-beta4</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>

        <dependency>
            <groupId>com.typesafe.play</groupId>
            <artifactId>play_2.10</artifactId>
            <version>${play2.version}</version>
        </dependency>

        <!-- only if using Java -->
        <dependency>
            <groupId>com.typesafe.play</groupId>
            <artifactId>play-java_2.10</artifactId>
            <version>${play2.version}</version>
        </dependency>

        <!-- only if using JPA -->
        <dependency>
            <groupId>com.typesafe.play</groupId>
            <artifactId>play-java-jpa_2.10</artifactId>
            <version>${play2.version}</version>
        </dependency>

        <!-- only if using JPA -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.3.6.Final</version>
        </dependency>

        <!-- only if there are tests in the project -->
        <dependency>
            <groupId>com.typesafe.play</groupId>
            <artifactId>play-test_2.10</artifactId>
            <version>${play2.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${application.name}</finalName>
        <sourceDirectory>${basedir}/app</sourceDirectory>
        <resources>
            <resource>
                <directory>${basedir}/conf</directory>
            </resource>
            <resource>
                <directory>${basedir}/public</directory>
                <targetPath>public</targetPath>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>com.google.code.play2-maven-plugin</groupId>
                <artifactId>play2-maven-plugin</artifactId>
                <version>${play2.plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <mainLang>java</mainLang>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <webResources>
                        <resource>
                            <directory>${basedir}/lib</directory>
                            <targetPath>WEB-INF/lib</targetPath>
                        </resource>
                    </webResources>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <primaryArtifact>false</primaryArtifact>
                    <warSourceDirectory>${basedir}/war</warSourceDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>make-war</id>
                        <phase>package</phase>
                        <goals>
                            <goal>war</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
<!--                <configuration> -->
<!--                    <fork>true</fork> -->
<!--                    <meminitial>1024m</meminitial> -->
<!--                    <maxmem>2024m</maxmem> -->
<!--                </configuration> -->
            </plugin>
        </plugins>
    </build>
</project>

Original issue reported on code.google.com by fdlp...@gmail.com on 19 Aug 2014 at 10:41

GoogleCodeExporter commented 8 years ago
I plan to implement optional compilation in forked JVM option, of course with 
memory parameters configuration options, but I don't know when I will have time 
to do this.

For now you have to increase memory for Maven JVM. See comments about 
MAVEN_OPTS system variable in Maven run scripts ("mvn" or "mvn.bat" in "bin" 
subdirectory of Maven installation).

Original comment by gslowiko...@gmail.com on 19 Aug 2014 at 5:21

GoogleCodeExporter commented 8 years ago
This issue is for sbt-compiler-maven plugin 
(https://code.google.com/p/sbt-compiler-maven-plugin/), not play2-maven-plugin.

Original comment by gslowiko...@gmail.com on 25 Aug 2014 at 7:20