2015-06-13 142 views
1

我得到了在IntelliJ中制作的AppEngine应用程序的存储库。 当我的同事克隆回购工作时,该项目失去了对AppEngine的每一个引用(尽管他在他的计算机上),并且他必须手动添加每个库。IntelliJ Idea在Git上失去AppEngine集成

有没有办法避免这种情况?

这是我的.gitignore,witgh gitignore.io产生

### AppEngine ### 
# Google App Engine generated folder 
appengine-generated/ 


### Intellij ### 
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 

*.iml 

## Directory-based project format: 
.idea/ 
# if you remove the above rule, at least ignore the following: 

# User-specific stuff: 
# .idea/workspace.xml 
# .idea/tasks.xml 
# .idea/dictionaries 

# Sensitive or high-churn files: 
# .idea/dataSources.ids 
# .idea/dataSources.xml 
# .idea/sqlDataSources.xml 
# .idea/dynamic.xml 
# .idea/uiDesigner.xml 

# Gradle: 
# .idea/gradle.xml 
# .idea/libraries 

# Mongo Explorer plugin: 
# .idea/mongoSettings.xml 

## File-based project format: 
*.ipr 
*.iws 

## Plugin-specific files: 

# IntelliJ 
/out/ 

# mpeltonen/sbt-idea plugin 
.idea_modules/ 

# JIRA plugin 
atlassian-ide-plugin.xml 
+0

我认为你应该联系intellij支持 – edi9999

回答

1

,这可能不是你要找的答案,但我有最好的结果通过使用maven所有的App引擎项目进行的跨多个集成开发环境。 IntelliJ对maven(甚至是社区版)都有很好的支持,所以我真的推荐使用maven。通过使用maven,您还可以消除对任何应用引擎插件的需求等。它只是起作用。

根据要求,这是一个maven的pom.xml我在项目之一使用:

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>de.konqi.konqiapp</groupId> 
    <artifactId>appengine</artifactId> 
    <packaging>war</packaging> 

    <properties> 
     <appengine.target.version>1.9.12</appengine.target.version> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <dependencies> 
     <!-- Compile/runtime dependencies --> 
     <dependency> 
      <groupId>com.google.appengine</groupId> 
      <artifactId>appengine-api-1.0-sdk</artifactId> 
      <version>${appengine.target.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.appengine</groupId> 
      <artifactId>appengine-endpoints</artifactId> 
      <version>${appengine.target.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>servlet-api</artifactId> 
      <version>2.5</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>jstl</groupId> 
      <artifactId>jstl</artifactId> 
      <version>1.2</version> 
     </dependency> 
     <!-- Test Dependencies --> 
     <dependency> 
      <groupId>com.google.appengine</groupId> 
      <artifactId>appengine-testing</artifactId> 
      <version>${appengine.target.version}</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.google.appengine</groupId> 
      <artifactId>appengine-api-stubs</artifactId> 
      <version>${appengine.target.version}</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.8.1</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 

    <build> 
     <!-- for hot reload of the web application --> 
     <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory> 
     <resources> 
      <resource> 
       <directory>src/main/java</directory> 
       <includes> 
        <include>**/*.properties</include> 
       </includes> 
      </resource> 
      <resource> 
       <directory>src/main/resources</directory> 
       <includes> 
        <include>**/*.properties</include> 
       </includes> 
      </resource> 
     </resources> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <version>2.5.1</version> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>1.7</source> 
        <target>1.7</target> 
       </configuration> 
      </plugin> 
      <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> 
         <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> 
         </resource> 
        </webResources> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>com.google.appengine</groupId> 
       <artifactId>appengine-maven-plugin</artifactId> 
       <version>${appengine.target.version}</version> 
       <configuration> 
        <enableJarClasses>false</enableJarClasses> 
        <jvmFlags> 
         <jvmFlag>-Xdebug</jvmFlag> 
         <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> 
     </plugins> 
</project> 
+0

你可以分享你如何启用与maven的应用程序引擎? –

+0

确定 - 添加了pom.xml。请务必查看https://cloud.google.com/appengine/docs/java/tools/maven。一旦将pom.xml放入项目根目录中,就可以在IntelliJ中将项目打开为maven项目。我在.gitignore中拥有所有与IntelliJ相关的东西,因此项目将由pom导入,而不是在项目配置中的某些(通常是假的)设置。 – konqi

0

每当我Intelij理念& App Engine的工作,我包括在库中的.idea目录,但不包括workspace.xml。它最适合我