0

我按照迁移文档和 git repo ( https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine/endpoints-frameworks-v2 ) 中的 v2 示例迁移到云端点 v2。但是,我不确定如何设置 jvmFlag(s) 以指定其他属性,如 backend_store、端口、启用调试等,就像它在 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。

4

1 回答 1

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>
于 2017-08-25T05:05:26.647 回答