简体   繁体   中英

Google AppEngine conflict using Maven to compile with app.yaml in Codenvy

My project configuration pom.xml contains:

<gae.version>1.8.6</gae.version>

And later on references the web.xml directly...

     <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
               <webXml>src/main/webapp/WEB-INF/web.xml</webXml>
           <webResources>
              <resource>
                 <directory>src/main/webapp/WEB-INF</directory>
                 <targetPath>WEB-INF</targetPath>
              </resource>
           </webResources>
        </configuration>
     </plugin>

....but my web.xml is empty because I'm using app.yaml to define my handlers. Can I remove this plugin element without any consequences? What about the maven-surefire-plugin?

Moving this out of comments (and with the benefit of coffee).

A few reasons to prefer appengine-web.xml over app.yaml if you're working with Java.

  1. You'll get better tooling support. This is a weak reason at the moment, but as the tooling around App Engine grows, .xml config will likely get the better support. I think you're running into one such case now.

  2. If you're partially in the servlet world, or are working with people who are, web.xml is a norm.

  3. My experience is that that using app.yaml limits your chances of getting help, because the pool of Java GAE users who also use app.yaml is small. Caveat: There's probably some sampling bias here.

  4. If you think you might want to move off of App Engine some day, say, onto RedHat's Cape Dwarf , I'm pretty sure they don't support app.yaml . (Not that it would be a huge change.)

That said, if you have a simple use case and app.yaml is working for you, stick with it. It is a supported option.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM