Maven deploy plugin is asking for SCM details, what if I don't use one?
I've followed the instructions for configuring Maven for building android projects, this is what my POM looks like
<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.example</groupId>
<artifactId>MavenMess</artifactId>
<version>1</version>
<packaging>apk</packaging>
<name>Maven Android Plugin - samples</name>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>maven-android-plugin</artifactId>
<version>2.6.0</version>
<configuration>
<sdk>
<!-- 开发者_运维百科platform or api level (api level 4 = platform 1.6)-->
<platform>8</platform>
</sdk>
<emulator>
<!-- the name of the avd device to use for starting the emulator-->
<avd>GoogleAPIs</avd>
</emulator>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<!-- version 2.3 defaults to java 1.5, so no further configuration needed-->
<version>2.3</version>
</plugin>
</plugins>
</build>
</project>
I can run mvn install
ok, but when I run mvn deploy
I get the following error
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-deploy-plugin:2.4
check that the following section of the pom.xml is present and correct:
<distributionManagement>
<!-- use the following if you're not using a snapshot version. -->
<repository>
<id>repo</id>
<name>Repository Name</name>
<url>scp://host/path/to/repo</url>
</repository>
<!-- use the following if you ARE using a snapshot version. -->
<snapshotRepository>
<id>repo</id>
<name>Repository Name</name>
<url>scp://host/path/to/repo</url>
</snapshotRepository>
</distributionManagement>
Cause: Class 'org.apache.maven.artifact.repository.ArtifactRepository' cannot be instantiated
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Sun Nov 14 18:56:41 GMT 2010
[INFO] Final Memory: 58M/543M
[INFO] ------------------------------------------------------------------------
What if I don't use a repository, how can I get around this?
If you deploy
then you must provide a place to deploy to (a repository). The whole point of deploy
is to upload your build to some server.
Use package
if you just want to create an application package.
Update: Use android:deploy
to deploy to the emulator or device.
If I remember correctly, if you just set up a dummy repository (e.g. valid url
format, but invalid server or so), Maven will complain, but do its work.
精彩评论