Appengine云端点v2:在devserver

时间:2017-08-25 04:45:05

标签: java maven google-app-engine google-cloud-endpoints-v2

我迁移到迁移文档之后的云端点v2和来自git repo(https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine/endpoints-frameworks-v2)的v2示例。但是,我不确定如何设置jvmFlag(s)以指定其他属性,如backend_store,port,enable debug等,就像它在v1中一样。

这是我的pom.xml中的构建标记。

<build>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
    <plugins>
        <!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>versions-maven-plugin</artifactId>
            <version>2.1</version> <executions> <execution> <phase>compile</phase> <goals>
            <goal>display-dependency-updates</goal> <goal>display-plugin-updates</goal>
            </goals> </execution> </executions> </plugin> -->
        <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>1.3.1</version>
            <configuration>
                <devserver.storagePath>/Users/user/Documents/development/health/local_db.bin</devserver.storagePath>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>endpoints-framework-maven-plugin</artifactId>
            <version>1.0.0</version>
            <configuration>
                <!-- plugin configuration -->
                <hostname>amplified-lamp-688.appspot.com</hostname>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <version>3.6.2</version>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <!--<enableJarClasses>false</enableJarClasses>-->
                <!--&lt;!&ndash; Comment in the below snippet to bind to all IPs instead of just-->
                    <!--localhost &ndash;&gt;-->
                <!--&lt;!&ndash; address>0.0.0.0</address> &ndash;&gt;-->
                <!--<port>8080</port>-->
                <!--&lt;!&ndash; Comment in the below snippet to enable local debugging with a remove-->
                    <!--debugger like those included with Eclipse or IntelliJ &ndash;&gt;-->
                <!--<jvmFlags>-->
                    <!--<jvmFlag>-Xdebug</jvmFlag>-->
                    <!--<jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>-->
                    <!--<jvmFlag>-Ddatastore.backing_store=/Users/user/Documents/development/health/local_db.bin</jvmFlag>-->
                    <!--<jvmFlag>-Ddatastore.default_high_rep_job_policy_unapplied_job_pct=10</jvmFlag>-->
                <!--</jvmFlags>-->
            </configuration>
            <executions>
                <execution>
                    <phase>compile</phase>
                    <goals>
                        <goal>display-dependency-updates</goal>
                        <goal>display-plugin-updates</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

请帮助配置jvmFlags。

1 个答案:

答案 0 :(得分:0)

这是指定jvmFlags

的解决方案之一
        <plugin>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>1.3.1</version>
            <configuration>
                <!--<devserver.storagePath>/Users/user/Documents/development/health/local_db.bin</devserver.storagePath>-->
                <devserver:port>8181</devserver:port>
                <devserver.jvmFlags>-Xdebug</devserver.jvmFlags>
                <devserver.jvmFlags>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</devserver.jvmFlags>
                <devserver.jvmFlags>-Ddatastore.backing_store=/Users/user/Documents/development/health/local_db.bin</devserver.jvmFlags>
            </configuration>
        </plugin>