2014-07-22 4 views
0

Eclipse 용 M2E - Maven 통합을 사용하여 내가 구성한 Android 프로젝트 (구성> Maven 프로젝트로 변환)가 있습니다. 프로젝트는 apklib로 변형 된 google play services 라이브러리를 사용합니다. 필자는이 pom.xml에 대한 의존성을 프로젝트에 추가했습니다. 나는 치어를 자동으로 구축 된 것을 언급해야,하지만 난에 의해 생성 된 하나를 대체 : 나는 새로 설치 않은 그 후응용 프로그램을 maven으로 만들 수 있지만 Android 응용 프로그램으로 만들 수는 없습니다.

mvn help:effective-pom 

및 실행 설정에서 다음과 같은 목표를 가지고, 받는다는와 프로젝트를 구축 :

clean install -Dandroid.sdk.path="path to my sdk" android:deploy android:run 

모든 것이 제대로 작동하지만 내 프로젝트에서 오류가 발생하여 Android 앱으로 실행할 수 없습니다. Google 도서관과 관련된 모든 것이 인식되지 않는 것 같습니다. 내 pom.xml 파일은 다음과 같습니다

<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>MyProject</groupId> 
<artifactId>MyProject</artifactId> 
<version>1.1-SNAPSHOT</version> 
<name>MyProject</name> 
<!-- <packaging>apk</packaging> --> <!-- if i try to add packaging it will give an error --> 
<dependencies> 
    <dependency> 
     <groupId>com.google.air</groupId> 
     <artifactId>googleplayair</artifactId> 
     <version>1.1</version> 
     <type>apklib</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.crashlytics</groupId> 
     <artifactId>crashlytics</artifactId> 
     <version>1.0</version> 
    </dependency> 
</dependencies> 
<repositories> 
    <repository> 
     <snapshots> 
      <enabled>false</enabled> 
     </snapshots> 
     <id>central</id> 
     <name>Central Repository</name> 
     <url>http://repo.maven.apache.org/maven2</url> 
    </repository> 
</repositories> 
<pluginRepositories> 
    <pluginRepository> 
     <releases> 
      <updatePolicy>never</updatePolicy> 
     </releases> 
     <snapshots> 
      <enabled>false</enabled> 
     </snapshots> 
     <id>central</id> 
     <name>Central Repository</name> 
     <url>http://repo.maven.apache.org/maven2</url> 
    </pluginRepository> 
</pluginRepositories> 
<build> 
    <sourceDirectory>/User/Documents/eclipse/cruzcampo-android/app/cruzcampo/src/main/java</sourceDirectory> 
    <scriptSourceDirectory>/User/Documents/eclipse/MyProject/src/main/scripts</scriptSourceDirectory> 
    <testSourceDirectory>/User/Documents/eclipse/MyProject/src/test/java</testSourceDirectory> 
    <outputDirectory>/User/Documents/eclipse/MyProject/target/classes</outputDirectory> 
    <testOutputDirectory>/User/Documents/eclipse/MyProject/target/test-classes</testOutputDirectory> 
    <resources> 
     <resource> 
      <directory>/User/Documents/eclipse/MyProject/src/main/resources</directory> 
     </resource> 
    </resources> 
    <testResources> 
     <testResource> 
      <directory>/User/Documents/eclipse/MyProject/src/test/resources</directory> 
     </testResource> 
    </testResources> 
    <directory>/User/Documents/eclipse/MyProject/target</directory> 
    <finalName>MyProject-1.1-SNAPSHOT</finalName> 
    <pluginManagement> 
     <plugins> 
      <plugin> 
       <artifactId>maven-antrun-plugin</artifactId> 
       <version>1.3</version> 
      </plugin> 
      <plugin> 
       <artifactId>maven-assembly-plugin</artifactId> 
       <version>2.2-beta-5</version> 
      </plugin> 
      <plugin> 
       <artifactId>maven-dependency-plugin</artifactId> 
       <version>2.8</version> 
      </plugin> 
      <plugin> 
       <artifactId>maven-release-plugin</artifactId> 
       <version>2.3.2</version> 
      </plugin> 
      <!-- </plugins> --> 
      <!-- </pluginManagement> --> 
      <!-- <plugins> --> 
      <plugin> 
       <artifactId>maven-clean-plugin</artifactId> 
       <version>2.5</version> 
       <executions> 
        <execution> 
         <id>default-clean</id> 
         <phase>clean</phase> 
         <goals> 
          <goal>clean</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <artifactId>maven-install-plugin</artifactId> 
       <version>2.4</version> 
       <executions> 
        <execution> 
         <id>default-install</id> 
         <phase>install</phase> 
         <goals> 
          <goal>install</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <artifactId>maven-resources-plugin</artifactId> 
       <version>2.6</version> 
       <executions> 
        <execution> 
         <id>default-resources</id> 
         <phase>process-resources</phase> 
         <goals> 
          <goal>resources</goal> 
         </goals> 
        </execution> 
        <execution> 
         <id>default-testResources</id> 
         <phase>process-test-resources</phase> 
         <goals> 
          <goal>testResources</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.12.4</version> 
       <executions> 
        <execution> 
         <id>default-test</id> 
         <phase>test</phase> 
         <goals> 
          <goal>test</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.5.1</version> 
       <executions> 
        <execution> 
         <id>default-testCompile</id> 
         <phase>test-compile</phase> 
         <goals> 
          <goal>testCompile</goal> 
         </goals> 
        </execution> 
        <execution> 
         <id>default-compile</id> 
         <phase>compile</phase> 
         <goals> 
          <goal>compile</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <artifactId>maven-jar-plugin</artifactId> 
       <version>2.4</version> 
       <executions> 
        <execution> 
         <id>default-jar</id> 
         <phase>package</phase> 
         <goals> 
          <goal>jar</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <artifactId>maven-deploy-plugin</artifactId> 
       <version>2.7</version> 
       <executions> 
        <execution> 
         <id>default-deploy</id> 
         <phase>deploy</phase> 
         <goals> 
          <goal>deploy</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <artifactId>maven-site-plugin</artifactId> 
       <version>3.3</version> 
       <executions> 
        <execution> 
         <id>default-site</id> 
         <phase>site</phase> 
         <goals> 
          <goal>site</goal> 
         </goals> 
         <configuration> 
          <outputDirectory>/User/Documents/eclipse/MyProject/target/site</outputDirectory> 
          <reportPlugins> 
           <reportPlugin> 
            <groupId>org.apache.maven.plugins</groupId> 
            <artifactId>maven-project-info-reports-plugin</artifactId> 
           </reportPlugin> 
          </reportPlugins> 
         </configuration> 
        </execution> 
        <execution> 
         <id>default-deploy</id> 
         <phase>site-deploy</phase> 
         <goals> 
          <goal>deploy</goal> 
         </goals> 
         <configuration> 
          <outputDirectory>/User/Documents/eclipse/MyProject/target/site</outputDirectory> 
          <reportPlugins> 
           <reportPlugin> 
            <groupId>org.apache.maven.plugins</groupId> 
            <artifactId>maven-project-info-reports-plugin</artifactId> 
           </reportPlugin> 
          </reportPlugins> 
         </configuration> 
        </execution> 
       </executions> 
       <configuration> 
        <outputDirectory>/User/Documents/eclipse/MyProject/target/site</outputDirectory> 
        <reportPlugins> 
         <reportPlugin> 
          <groupId>org.apache.maven.plugins</groupId> 
          <artifactId>maven-project-info-reports-plugin</artifactId> 
         </reportPlugin> 
        </reportPlugins> 
       </configuration> 
      </plugin> 

      <plugin> 
       <groupId> 
        com.jayway.maven.plugins.android.generation2 
       </groupId> 
       <artifactId>android-maven-plugin</artifactId> 
       <version>3.8.2</version> 
       <configuration> 
        <sdk> 
         <platform>19</platform> 
        </sdk> 
       </configuration> 

       <extensions>true</extensions> 
      </plugin> 

     </plugins> 

    </pluginManagement> 

</build> 
<reporting> 
    <outputDirectory>/User/Documents/eclipse/MyProject/target/site</outputDirectory> 
</reporting> 

내가 지금 메이븐이 잘 작동하는지 생각하지만, 문제는 안드로이드가있다. 제안 사항이 있으십니까?

답변

0

Eclipse ADT는 apklib 종속성에 대한 Maven 아카이브 형식을 지원하지 않습니다. Eclipse에서 성공적으로 컴파일하려면 "Mavenised"의 전체 소스 (즉, Maven 좌표가 앱 POM에 선언 된 종속성과 일치하는 POM 포함)이 필요합니다. Android 라이브러리 프로젝트를 Eclipse 작업 영역으로 가져 왔습니다.

관련 문제