我制作了一个小型 android 库,我想在中央 maven 存储库中提供它。我正在尝试按照此处列出的步骤
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
在我进入 mvn release:perform 阶段之前,一切似乎都运行良好。然后我收到以下错误。
[信息] /Volumes/AndroidDisk/persistent-cookies/target/checkout/AndroidManifest.xml:5:错误:错误:找不到与给定名称匹配的资源(在“图标”处,值为“@drawable/icon”)。[INFO] /Volumes/AndroidDisk/persistent-cookies/target/checkout/AndroidManifest.xml:5:错误:错误:找不到与给定名称匹配的资源(在“标签”处,值为“@string/app_name”)。[错误] 生成源时出错。org.apache.maven.plugin.MojoExecutionException: 在 com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute( GenerateSourcesMojo.java:107) 在 org.apache.maven.plugin.DefaultBuildPluginManager。
所以它似乎在找到 res 文件夹时遇到了问题。当我执行 mvn clean install 时,项目构建正常。
POM...
<?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>
<groupId>com.github.samddman</groupId>
<artifactId>persistentcookiestore</artifactId>
<version>1.0.1-SNAPSHOT</version>
<packaging>apklib</packaging>
<name>persistentcookies</name>
<description>A cookie store which persists cookies across app restarts</description>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<url>https://github.com/samddman/persistent-cookies</url>
<licenses>
<license>
<name>GNU General Public License, version 2 (GPL-2.0)</name>
<url>http://opensource.org/licenses/gpl-2.0.php</url>
</license>
</licenses>
<scm>
<url>git@github.com:samddman/persistent-cookies.git</url>
<connection>scm:git:git@github.com:samddman/persistent-cookies.git</connection>
<developerConnection>scm:git:git@github.com:samddman/persistent-cookies.git</developerConnection>
</scm>
<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.pivotallabs</groupId>
<artifactId>robolectric</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.2.2_r2</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- <plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<sdk>
<platform>17</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin> -->
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>17</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/res</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/templates/res</directory>
<targetPath>${project.basedir}/res</targetPath>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
我究竟做错了什么?