简体   繁体   English

Maven部署插件要求提供SCM详细信息,如果我不使用它,该怎么办?

[英]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.

相关问题 如果我在 android 中不使用 launchMode “singleTask” 会怎样? - What happens if I don't use launchMode “singleTask” in android? 如何使用publishNonDefault但仅将一个工件部署到Maven - How to use publishNonDefault but deploy only one artifact to maven 我问是因为我不知道如何将 Linux post 命令更改为 Retrofit 2 - I'm asking because I don't know how to change the Linux post command into Retrofit 2 什么是Android Maven插件? - What is the Android Maven plugin? 当条件为真并且我不想实现任何东西时,我应该在 if 语句中使用什么? - What should I use in if statement when the condition is true and I don't want to implement anything? 如果我想使用Maven,是否需要安装ADT插件? - Do I need to install an ADT plugin if I want to use Maven? Android maven插件,无法部署到设备 - Android maven plugin, unable to deploy to device 如果没有上下文该怎么办? - What to do if I don't have Context? android NullPointerException,但我不知道什么 - android NullPointerException but I don't know on what 在后台播放音乐时停止播放音乐。我不想将其用作服务。我有什么选择? - Music stops when playing in background.I don't want to use it as a service..what are my alternatives?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM