MapChange プロジェクトのセットアップを試みてい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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>MapChange</name>
<url>http://github.com/bricolsoftconsulting/MapChange</url>
<artifactId>mapchange</artifactId>
<groupId>com.bricolsoftconsulting</groupId>
<version>0.1.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<android.version>2.1_r3</android.version>
<android.version.maps>7_r1</android.version.maps>
</properties>
<dependencies>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>${android.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android.maps</groupId>
<artifactId>maps</artifactId>
<version>${android.version.maps}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.0</version>
</plugin>
</plugins>
</build>
</project>
Maven Android SDK Deployer projectを使用して SDK 依存関係をインストールしました。
Mavenを実行すると$ mvn clean install
、次のコンパイル エラーが返されます。
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: \
2.3.2:compile (default-compile) on project mapchange: \
Compilation failure: Compilation failure:
[ERROR] /home/john/dev/MapChange/src/com/bricolsoftconsulting/mapchange/ \
MyMapActivity.java:[40,18] error: package R does not exist
[ERROR] /home/john/dev/MapChange/src/com/bricolsoftconsulting/mapchange/ \
MyMapActivity.java:[43,39] error: package R does not exist