在eclipse luna中运行maven项目
Posted
技术标签:
【中文标题】在eclipse luna中运行maven项目【英文标题】:running maven project in eclipse luna 【发布时间】:2014-08-19 14:44:41 【问题描述】:我已经安装了所有东西,我正在使用 eclipse luna ..我正在尝试运行这个项目“示例”但到目前为止没有运气 https://github.com/devnied/EMV-NFC-Paycard-Enrollment..I 已经安装了所有东西并使用了 eclipse luna 但它给了我 android v4 兼容性错误..请帮帮我
[ERROR] Failed to execute goal on project sample: Could not resolve dependencies for project com.github.devnied.emvnfccard:sample:apk:1.1.1-SNAPSHOT: Failure to find android.support:compatibility-v4:jar:20.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
它的 pom.xml 是:
<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>
<artifactId>sample</artifactId>
<packaging>apk</packaging>
<name>EMV NFC android paycard reader</name>
<parent>
<groupId>com.github.devnied.emvnfccard</groupId>
<artifactId>parent</artifactId>
<version>1.1.1-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>20.0.0-rc1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.github.devnied.emvnfccard</groupId>
<artifactId>library</artifactId>
<version>1.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>crouton</artifactId>
<groupId>de.keyboardsurfer.android.widget</groupId>
<version>1.8.5</version>
<exclusions>
<exclusion>
<groupId>com.android.support</groupId>
<artifactId>support-v4</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>my.company.name.packageName.TestMain</mainClass>
<arguments>
<argument>myArg1</argument>
<argument>myArg2</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
【问题讨论】:
在 Central 中找不到任何 SNAPSHOT 版本。 那么解决方案是什么?请帮忙 【参考方案1】:使用发布版本而不是 SNAPSHOT:
<dependency>
<groupId>com.github.devnied.emvnfccard</groupId>
<artifactId>sample</artifactId>
<version>1.1.0</version>
</dependency>
或添加包含此库的 SNAPSHOT 版本的存储库(如果必须使用 1.1.1-SNAPSHOT)
【讨论】:
如何添加包含快照版本的存储库。请指导mee。 要添加存储库,请查看此文档link,但可能没有人使用此库。检查文档,也许this 会有所帮助。您可以随时自行构建此版本 - 它是开源的。以上是关于在eclipse luna中运行maven项目的主要内容,如果未能解决你的问题,请参考以下文章