2015-06-13 51 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。它最適合我