问题描述
导入了5个maven项目实际上是一个项目中的不同层,用maven编译dubbo的服务会有如下报错,找了半天没找到解决方法,求坛子里的大神相助了。Failedtoexecutegoalonprojectjtd-service-dubbo:Missing:----------1)cc.chengpai.jtd:jtd-service-api:jar:1.0-SNAPSHOTTrydownloadingthefilemanuallyfromtheprojectwebsite.Then,installitusingthecommand:mvninstall:install-file-DgroupId=cc.chengpai.jtd-DartifactId=jtd-service-api-Dversion=1.0-SNAPSHOT-Dpackaging=jar-Dfile=/path/to/fileAlternatively,ifyouhostyourownrepositoryyoucandeploythefilethere:mvndeploy:deploy-file-DgroupId=cc.chengpai.jtd-DartifactId=jtd-service-api-Dversion=1.0-SNAPSHOT-Dpackaging=jar-Dfile=/path/to/file-Durl=[url]-DrepositoryId=[id]Pathtodependency:1)cc.chengpai.jtd:jtd-service-dubbo:pom:pom:1.0-SNAPSHOT2)cc.chengpai.jtd:jtd-service-api:jar:1.0-SNAPSHOT----------1requiredartifactismissing.forartifact:cc.chengpai.jtd:jtd-service-dubbo:pom:1.0-SNAPSHOTfromthespecifiedremoterepositories:opensesame.releases(http://code.alibabatech.com/mvn/releases,releases=true,snapshots=false),central(http://repo1.maven.org/maven2,releases=true,snapshots=false)->[Help1][ERROR][ERROR]Toseethefullstacktraceoftheerrors,re-runMavenwiththe-eswitch.[ERROR]Re-runMavenusingthe-Xswitchtoenablefulldebuglogging.[ERROR][ERROR]Formoreinformationabouttheerrorsandpossiblesolutions,pleasereadthefollowingarticles:[ERROR][Help1]http://cwiki.apache.org/confluence/display/MAVEN/MultipleArtifactsNotFoundExceptionjtd-service-dubbo中pom.xml文件的内容是:<?xmlversion="1.0"?><projectxsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd"xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><modelVersion>4.0.0</modelVersion><parent><groupId>cc.chengpai.jtd</groupId><artifactId>jtd-parent</artifactId><version>1.0</version></parent><artifactId>jtd-service-dubbo</artifactId><packaging>jar</packaging><version>${modules.version}</version><name>jtd-DubboService</name><description>-</description><build><pluginManagement><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-dependency-plugin</artifactId><executions><execution><id>copy</id><phase>package</phase><goals><goal>copy-dependencies</goal></goals><configuration><outputDirectory>${project.build.directory}/lib</outputDirectory></configuration></execution></executions></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jar-plugin</artifactId><version>2.4</version><configuration><archive><manifest><addClasspath>true</addClasspath><classpathPrefix>lib/</classpathPrefix><mainClass>com.alibaba.dubbo.container.Main</mainClass></manifest></archive></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>com.alibaba.dubbo.container.Main</mainClass><arguments><argument>arg0</argument><argument>arg1</argument></arguments></configuration></execution></executions></plugin></plugins></pluginManagement><defaultGoal>compile</defaultGoal></build><dependencies><!--spring--><dependency><groupId>org.springframework</groupId><artifactId>spring-test</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-core</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-beans</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-web</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework.security</groupId><artifactId>spring-security-core</artifactId><version>${spring.security.version}</version></dependency><dependency><groupId>org.springframework.security</groupId><artifactId>spring-security-web</artifactId><version>${spring.security.version}</version></dependency><dependency><groupId>org.springframework.security</groupId><artifactId>spring-security-config</artifactId><version>${spring.security.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-orm</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-context-support</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.aspectj</groupId><artifactId>aspectjweaver</artifactId><version>1.6.8</version></dependency><dependency><groupId>javax.mail</groupId><artifactId>mail</artifactId><version>1.4.7</version></dependency><dependency><groupId>org.apache.velocity</groupId><artifactId>velocity</artifactId><version>1.7</version></dependency><dependency><groupId>cc.chengpai.jtd</groupId><artifactId>jtd-service-api</artifactId><version>${project.version}</version></dependency><dependency><groupId>com.caucho</groupId><artifactId>hessian</artifactId><version>4.0.7</version></dependency><dependency><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId><version>2.5</version></dependency><dependency><groupId>org.mortbay.jetty</groupId><artifactId>jetty</artifactId><version>6.1.26</version></dependency><!--slf4j--><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>1.6.6</version></dependency><dependency><groupId>ch.qos.logback</groupId><artifactId>logback-core</artifactId><version>1.0.13</version></dependency><dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId><version>1.0.13</version></dependency><!--mysql--><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.10</version></dependency><dependency><groupId>c3p0</groupId><artifactId>c3p0</artifactId><version>0.9.1.2</version></dependency><dependency><groupId>cglib</groupId><artifactId>cglib</artifactId><version>2.2.2</version></dependency><dependency><groupId>commons-codec</groupId><artifactId>commons-codec</artifactId><version>1.2</version></dependency><dependency><groupId>commons-httpclient</groupId><artifactId>commons-httpclient</artifactId><version>3.1</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>dubbo</artifactId><version>${dubbo.version}</version><exclusions><exclusion><artifactId>spring</artifactId><groupId>org.springframework</groupId></exclusion></exclusions></dependency><dependency><groupId>com.github.sgroschupf</groupId><artifactId>zkclient</artifactId><version>0.1</version></dependency><dependency><groupId>org.slf4j</groupId><artifactId>jcl-over-slf4j</artifactId><version>1.7.5</version></dependency></dependencies><repositories><repository><id>opensesame.releases</id><url>http://code.alibabatech.com/mvn/releases</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></repository></repositories></project>
解决方案
本帖最后由 qq_15247769 于 2014-12-07 14:16:14 编辑
解决方案二:
是不是只能运行其中一个工程呢?即运行单个工程是可以的,但是多个工程一起运行就报错呢?
解决方案三:
不是的。每个不同的项目有不同分工的,我只是编译其中一个就会有这样的报错,还没有到都开起来
解决方案四:
上面不是提示少依赖吗
解决方案五:
mavencleanmaveninstall
解决方案六:
maven报错?你先按照步骤来吧把以前额清空了mevanclean