【问题标题】:Maven deploy plugin is asking for SCM details, what if I don't use one?Maven 部署插件要求提供 SCM 详细信息,如果我不使用怎么办?
【发布时间】:2010-11-14 19:03:09
【问题描述】:

我已经按照instructions for configuring 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>

我可以运行mvn install 好的,但是当我运行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] ------------------------------------------------------------------------

如果我不使用存储库,我该如何解决这个问题?

【问题讨论】:

    标签: android maven-2


    【解决方案1】:

    如果您deploy,那么您必须提供一个部署到(存储库)的位置。 deploy 的重点是将您的构建上传到某个服务器。

    如果您只想创建应用程序包,请使用package

    更新:使用android:deploy 部署到模拟器或设备。

    【讨论】:

    【解决方案2】:

    如果我没记错的话,如果你只是设置了一个虚拟存储库(例如有效的url 格式,但服务器无效左右),Maven 会抱怨,但会正常工作。

    【讨论】:

    • 我试过了,然后它给出了一个不同的错误。 ` 验证失败:无法连接。原因:java.net.UnknownHostException: host`
    • 那我记错了:) 你试过本地供应商-maven.apache.org/scm/local.html吗?您可以放置​​一些虚拟文件夹(例如 Unix 上的 /tmp 或 Windows 上的 c:/temp)。
    • ...但我仍然认为可以通过更改连接以某种方式纠正它。试试这个:maven.apache.org/scm/maven-scm-plugin/usage.html - 只需将连接和 developerConnection both 更改为有效的东西,除了主机名不正确。我最近遇到了类似的问题,我想我以某种方式解决了这些问题,但我不记得所有的细节......
    • 似乎不是一个可行的解决方案,因为它仍然尝试从 SCM 检索以前的版本号,如果您提供一个虚拟 SCM,它会返回一个连接异常 :(
    • sigh 你试过本地供应商吗?
    猜你喜欢
    • 2013-10-03
    • 1970-01-01
    • 2011-03-09
    • 2016-12-07
    • 1970-01-01
    • 2016-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多