问题描述
[root@localhost storm-starter-master]# mvn -f m2-pom.xml package[INFO] Scanning for projects...Downloading: http://repo.maven.apache.org/maven2/com/theoryinpractise/clojure-maven-plugin/1.3.8/clojure-maven-plugin-1.3.8.pom[ERROR] The build could not read 1 project -> [Help 1][ERROR] [ERROR] The project storm.starter:storm-starter:0.0.1-SNAPSHOT (/home/lmy/storm-starter-master/m2-pom.xml) has 1 error[ERROR] Unresolveable build extension: Plugin com.theoryinpractise:clojure-maven-plugin:1.3.8 or one of its dependencies could not be resolved: Failed to collect dependencies for com.theoryinpractise:clojure-maven-plugin:jar:1.3.8 (): Failed to read artifact descriptor for com.theoryinpractise:clojure-maven-plugin:jar:1.3.8: Could not transfer artifact com.theoryinpractise:clojure-maven-plugin:pom:1.3.8 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known: Unknown host repo.maven.apache.org: Name or service not known -> [Help 2][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/ProjectBuildingException[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException 问题补充:附 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/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>storm.starter</groupId><artifactId>storm-starter</artifactId><version>0.0.1-SNAPSHOT</version><packaging>jar</packaging><name>storm-starter</name><url>https://github.com/nathanmarz/storm-starter</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><repositories><repository><id>github-releases</id><url>http://oss.sonatype.org/content/repositories/github-releases/</url></repository><repository><id>clojars.org</id><url>http://clojars.org/repo</url></repository> <repository> <id>repo.maven.apache.org</id> <url>http://repo.maven.apache.org/maven2</url> </repository> <repository> <id>twitter4j</id> <url>http://twitter4j.org/maven2</url> </repository></repositories><dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>3.8.1</version><scope>test</scope></dependency><dependency><groupId>storm</groupId><artifactId>storm</artifactId><version>0.8.1</version><!-- keep storm out of the jar-with-dependencies --><scope>provided</scope></dependency><dependency><groupId>org.twitter4j</groupId><artifactId>twitter4j-core</artifactId><version>[2.2,)</version></dependency><dependency><groupId>org.twitter4j</groupId><artifactId>twitter4j-stream</artifactId><version>[2.2,)</version></dependency><dependency><groupId>com.googlecode.json-simple</groupId><artifactId>json-simple</artifactId><version>1.1</version></dependency></dependencies><build><sourceDirectory>src/jvm</sourceDirectory><resources><resource><directory>${basedir}/multilang</directory></resource></resources><plugins> <!-- bind the maven-assembly-plugin to the package phase this will create a jar file without the storm dependencies suitable for deployment to a cluster. --><plugin><artifactId>maven-assembly-plugin</artifactId><configuration><descriptorRefs><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs><archive><manifest><mainClass></mainClass></manifest></archive></configuration><executions><execution><id>make-assembly</id><phase>package</phase><goals><goal>single</goal></goals></execution></executions></plugin> <plugin> <groupId>com.theoryinpractise</groupId> <artifactId>clojure-maven-plugin</artifactId> <version>1.3.8</version> <extensions>true</extensions> <configuration> <sourceDirectories> <sourceDirectory>src/clj</sourceDirectory> </sourceDirectories> </configuration> <executions> <execution> <id>compile</id> <phase>compile</phase> <goals> <goal>compile</goal> </goals> </execution> <execution> <id>test</id> <phase>test</phase> <goals> <goal>test</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin></plugins></build></project>
解决方案
引用由于Storm-starter使用twitter4j这个仓库来下载twitter4j-core这两个包,而twitter4j已经被伟大的长城盾了。参考:http://www.cnblogs.com/zeutrap/archive/2012/10/11/2720528.html
解决方案二:
maven clean package 或者执行时加上 -X 可以看到详细的错误信息
解决方案三:
有时候下载到一半断了就可能出现这种问题,一般都是删包重来