[英]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 我已经按照说明配置Maven来构建android项目,这就是我的POM的样子
<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 我可以运行mvn install
ok,但是当我运行mvn deploy
出现以下错误
[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). 如果deploy
则必须提供一个部署到(存储库)的地方。 The whole point of deploy
is to upload your build to some server. deploy
的全部目的是将您的构建上传到某个服务器。
Use package
if you just want to create an application package. 使用package
,如果你只是想创建一个应用程序包。
Update: Use android:deploy
to deploy to the emulator or device. 更新:使用android:deploy
部署到仿真器或设备。
如果我没记错的话,如果您只是设置了一个虚拟存储库(例如,有效的url
格式,但是无效的服务器等),那么Maven会抱怨,但是会做它的工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.