Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine Appengine Maven插件-端点目标-启用对.discovery文件的筛选_Google App Engine_Maven_Google Cloud Endpoints_Maven War Plugin - Fatal编程技术网

Google app engine Appengine Maven插件-端点目标-启用对.discovery文件的筛选

Google app engine Appengine Maven插件-端点目标-启用对.discovery文件的筛选,google-app-engine,maven,google-cloud-endpoints,maven-war-plugin,Google App Engine,Maven,Google Cloud Endpoints,Maven War Plugin,接下来,我在Maven项目中实现了Google云端点 下面是我的pom.xml的属性 <properties> <appengine.app.id>xxxxxxxx</appengine.app.id> </properties> mystore-v1-rpc.discovery 为什么这些文件不像保存在WEB-INF文件夹中的任何其他文件那样被过滤 我在许多文件(WEB-INF父文件夹下)中使用Maven变量,这些值被替换为w/o问题

接下来,我在Maven项目中实现了Google云端点

下面是我的pom.xml的属性

<properties>
    <appengine.app.id>xxxxxxxx</appengine.app.id>
</properties>
mystore-v1-rpc.discovery

为什么这些文件不像保存在WEB-INF文件夹中的任何其他文件那样被过滤

我在许多文件(WEB-INF父文件夹下)中使用Maven变量,这些值被替换为w/o问题

如何调整配置以允许对.discovery文件进行筛选

我认为(在lib生成期间),appengine-web.xml中的
应用程序
值是在不解析该值的情况下获取的,并且在Maven构建期间,不应用过滤

我已经尝试将
true
添加到资源配置中,但没有成功

——编辑2014年1月25日---

在收到一些建议后,我需要澄清一件我在原始帖子中忘记写的事情

该问题与
端点\u get\u discovery\u doc

这是马文进球的记录

API Discovery Document written to ..\target\generated-sources\appengine-endpoints\WEB-INF/mystore-v3-rpc.discovery
API Discovery Document written to ..\target\generated-sources\appengine-endpoints\WEB-INF/mystore-androidtest-rpc.discovery
文件
\target\generated sources\appengine endpoints\WEB-INF/mystore-v3-rpc.discovery
由endpoints目标生成,不进行筛选

即使具有过滤特性

<resource>
    <directory>${project.build.directory}/generated-sources/appengine-endpoints</directory>
    <filtering>true</filtering>
    <includes>
        <include>WEB-INF/*.discovery</include>
        <include>WEB-INF/*.api</include>
    </includes>
</resource>

${project.build.directory}/generated sources/appengine endpoints
真的
WEB-INF/*.discovery
WEB-INF/*.api
生成的文件不会被过滤

可能问题在于,如果文件直接写入
${project.build.directory}/generated sources/appengine endpoints
文件夹,则不会对文件进行筛选?


    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <webXml>${project.build.directory}/generated-sources/appengine-endpoints/WEB-INF/web.xml</webXml>
                <webResources>
                    <!-- in order to interpolate version from pom into appengine-web.xml -->
                    <resource>
                        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                        <filtering>true</filtering>
                        <targetPath>WEB-INF</targetPath>
                    </resource>
                    <resource>
                        <!-- this is relative to the pom.xml directory -->
                        <directory>${project.build.directory}/generated-sources/appengine-endpoints</directory>
                        <!-- the list has a default value of ** -->
                        <includes>
                            <include>WEB-INF/*.discovery</include>
                            <include>WEB-INF/*.api</include>
                        </includes>
                        <filtering>true</filtering>
                    </resource>
                </webResources>
            </configuration>
        </plugin>
org.apache.maven.plugins maven战争插件 2.4 ${project.build.directory}/generated sources/appengine endpoints/WEB-INF/WEB.xml ${basedir}/src/main/webapp/WEB-INF 真的 WEB-INF ${project.build.directory}/generated sources/appengine endpoints WEB-INF/*.discovery WEB-INF/*.api 真的

0.0.0.0
8080
-agentlib:jdwp=transport=dt_socket,地址=8000,服务器=y,挂起=n
端点\u获取\u发现\u文档

我复制了您看到的bug。我不认为这是一个错误的项目配置或用户错误。似乎是maven appengine插件的问题。在使用了你的建议添加true之后,这似乎对我有效。注意appengine maven插件不执行过滤…maven war插件启动过滤。感谢@Ronald的提示。你能在这里发布你的配置吗?这样我就能更好地理解过滤属性放在哪里。嗨@Ronald,我用一些附加信息编辑了这个问题。
protocol": "rpc",
"rootUrl": "https://${appengine.app.id}.appspot.com/_ah/api/",
"rpcUrl": "https://${appengine.app.id}.appspot.com/_ah/api/rpc",
"rpcPath": "/_ah/api/rpc",
API Discovery Document written to ..\target\generated-sources\appengine-endpoints\WEB-INF/mystore-v3-rpc.discovery
API Discovery Document written to ..\target\generated-sources\appengine-endpoints\WEB-INF/mystore-androidtest-rpc.discovery
<resource>
    <directory>${project.build.directory}/generated-sources/appengine-endpoints</directory>
    <filtering>true</filtering>
    <includes>
        <include>WEB-INF/*.discovery</include>
        <include>WEB-INF/*.api</include>
    </includes>
</resource>
    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <webXml>${project.build.directory}/generated-sources/appengine-endpoints/WEB-INF/web.xml</webXml>
                <webResources>
                    <!-- in order to interpolate version from pom into appengine-web.xml -->
                    <resource>
                        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                        <filtering>true</filtering>
                        <targetPath>WEB-INF</targetPath>
                    </resource>
                    <resource>
                        <!-- this is relative to the pom.xml directory -->
                        <directory>${project.build.directory}/generated-sources/appengine-endpoints</directory>
                        <!-- the list has a default value of ** -->
                        <includes>
                            <include>WEB-INF/*.discovery</include>
                            <include>WEB-INF/*.api</include>
                        </includes>
                        <filtering>true</filtering>
                    </resource>
                </webResources>
            </configuration>
        </plugin>
<!--User the below Line, I also had the same problem that I solved using Note: <version>${app.version}</version><appId>${app.id}</appId> folow as per your configuration --!>                                
    <plugin>
    <groupId>com.google.appengine</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>${appengine.version}</version>
            <configuration>
                <enableJarClasses>false</enableJarClasses>
                <version>${app.version}</version>
                <appId>${app.id}</appId>
                <!-- Comment in the below snippet to bind to all IPs instead of just localhost -->
                <address>0.0.0.0</address>
                <port>8080</port>
                <!-- Comment in the below snippet to enable local debugging with a remote debugger
                     like those included with Eclipse or IntelliJ -->
                <jvmFlags>
                  <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
                </jvmFlags>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>endpoints_get_discovery_doc</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>