我的maven好像是缺少包,不知道怎么加自定义的包

Zeus 11 产品经理  2013-01-22 02:35:03

[ERROR] Failed to execute goal on project system_datacenter: Could not resolve dependencies for project com.harmony.civilaffairs:system_datacenter:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.harmony.hap:hap-mybatis:jar:1.0, com.harmony.hap:attachment-mybatis:jar:1.0, com.harmony.apportal:harmony-common:jar:2.3, com.harmony.apportal:harmony-client:jar:2.3: Failure to find com.harmony.hap:hap-mybatis:jar:1.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]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project system_datacenter: Could not resolve dependencies for project com.harmony.civilaffairs:system_datacenter:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.harmony.hap:hap-mybatis:jar:1.0, com.harmony.hap:attachment-mybatis:jar:1.0, com.harmony.apportal:harmony-common:jar:2.3, com.harmony.apportal:harmony-client:jar:2.3: Failure to find com.harmony.hap:hap-mybatis:jar:1.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
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.harmony.civilaffairs:system_datacenter:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.harmony.hap:hap-mybatis:jar:1.0, com.harmony.hap:attachment-mybatis:jar:1.0, com.harmony.apportal:harmony-common:jar:2.3, com.harmony.apportal:harmony-client:jar:2.3: Failure to find com.harmony.hap:hap-mybatis:jar:1.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
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:189)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: com.harmony.hap:hap-mybatis:jar:1.0, com.harmony.hap:attachment-mybatis:jar:1.0, com.harmony.apportal:harmony-common:jar:2.3, com.harmony.apportal:harmony-client:jar:2.3: Failure to find com.harmony.hap:hap-mybatis:jar:1.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
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:183)
... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: com.harmony.hap:hap-mybatis:jar:1.0, com.harmony.hap:attachment-mybatis:jar:1.0, com.harmony.apportal:harmony-common:jar:2.3, com.harmony.apportal:harmony-client:jar:2.3: Failure to find com.harmony.hap:hap-mybatis:jar:1.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
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)
... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find com.harmony.hap:hap-mybatis:jar:1.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
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:230)
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:204)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:427)
... 26 more
[ERROR]
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :system_datacenter


各位快帮帮我啊。
myeclipse8.6 maven 3.0.4
...全文
4823 13 点赞 打赏 收藏 举报
写回复
13 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
江紫枫 2014-09-25
吧runtime去掉就好了
  • 打赏
  • 举报
回复
嘎java嘎 2014-08-07
又学习啦!我今天也遇到了这个问题
  • 打赏
  • 举报
回复
zhu19774279 2013-03-14
7楼方法应该可行 不过确实建议本地架设私服,Nexus的中文资料很多,半天绝对足够
  • 打赏
  • 举报
回复
lvzg_005 2013-03-07
引用 6 楼 lpy3654321 的回复:
问题我已经把自己JAR复制m2\repository里了 POM里也已经引用了
复制的jar不行,需要安装到maven仓库中,使用install 命令
  • 打赏
  • 举报
回复
zhu19774279 2013-03-07
我觉得7楼的靠谱。不过还是建议lz架个私服,比如nexus什么的,管理起来方便很多,那东西学习一下也就是个把钟头的事
  • 打赏
  • 举报
回复
EverWHL 2013-01-23
昨天我也遇到这个问题 我的解决方案是在Prefernces-->Maven-->user Settings 里面点击Update settings 然后就好了。因为默认你配置settings.xml指向你的类库的时候,可能是没有加载进来吧,所以需要update一下。 你可以试试看这种方法行不行。 如果不行那可能就是jar包不全了
  • 打赏
  • 举报
回复
as5675020 2013-01-22
也可以直接指定到你自己的那个包地址上 <dependency> <groupId></groupId> <artifactId></artifactId> <version></version> <scope>system</scope> <systemPath></systemPath> </dependency>
  • 打赏
  • 举报
回复
Zeus 2013-01-22
引用 5 楼 as5675020 的回复:
最简单的方法就是你在你的 maven本地仓库中 新建一个文件夹 将你自定义的包放到里面 就可以在配置文件中引用了
问题我已经把自己JAR复制m2\repository里了 POM里也已经引用了
  • 打赏
  • 举报
回复
as5675020 2013-01-22
最简单的方法就是你在你的 maven本地仓库中 新建一个文件夹 将你自定义的包放到里面 就可以在配置文件中引用了
  • 打赏
  • 举报
回复
Zeus 2013-01-22
引用 3 楼 wjkxinxiang 的回复:
1 找到缺少的包 2 去找相关的人 3 deploy 到maven 私服上 4 package
我这个没有私服,就是在我的电脑上。
  • 打赏
  • 举报
回复
1 找到缺少的包 2 去找相关的人 3 deploy 到maven 私服上 4 package
  • 打赏
  • 举报
回复
Zeus 2013-01-22
  • 打赏
  • 举报
回复
Zeus 2013-01-22
<?xml version="1.0" encoding="UTF-8"?>
<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>com.harmony.civilaffairs</groupId>
  <artifactId>civilaffairs</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>这里发言,表示您接受了CSDN论坛的用户行为准则</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.com.harmony.hap>1.0</version.com.harmony.hap>
    <version.org.springframework>3.0.5.RELEASE</version.org.springframework>
    <version.org.apache.struts>2.2.3</version.org.apache.struts>
    <version.maven-checkstyle-plugin>2.6</version.maven-checkstyle-plugin>
    <version.findbugs-maven-plugin>2.3.2</version.findbugs-maven-plugin>
  </properties>
	  <dependencies>
	     <dependency>
	      <groupId>junit</groupId>
	      <artifactId>junit</artifactId>
	      <version>4.10</version>
	      <scope>test</scope>
	    </dependency>
	     <dependency>
			<groupId>org.lazyluke</groupId>
			<artifactId>log4jdbc-remix</artifactId>
			<version>0.2.7</version>
		</dependency>
		<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-log4j12</artifactId>
				<version>1.6.4</version>
			</dependency>
	    <dependency>
	      <groupId>com.harmony.hap</groupId>
	      <artifactId>hap-mybatis</artifactId>
	      <version>${version.com.harmony.hap}</version>
	    </dependency>
	    <dependency>
	      <groupId>com.harmony.hap</groupId>
	      <artifactId>attachment-mybatis</artifactId>
	      <version>${version.com.harmony.hap}</version>
	    </dependency>
	    <dependency>
	      <groupId>org.springframework</groupId>
	      <artifactId>spring-web</artifactId>
	      <version>${version.org.springframework}</version>
	      <type>jar</type>
	      <scope>compile</scope>
	    </dependency>
		<dependency>
		  <groupId>com.harmony.apportal</groupId>
		  <artifactId>harmony-common</artifactId>
		  <version>2.3</version>
		  <exclusions>
		  	<exclusion>
		  		<artifactId>log4j</artifactId>
		  		<groupId>log4j</groupId>
		  	</exclusion>
		  	<exclusion>
		  		<artifactId>icu4j</artifactId>
		  		<groupId>com.ibm.icu</groupId>
		  	</exclusion>
		  	<exclusion>
		  		<artifactId>xalan</artifactId>
		  		<groupId>xalan</groupId>
		  	</exclusion>
	  		<exclusion>
	  			<artifactId>xercesImpl</artifactId>
	  			<groupId>xerces</groupId>
	  		</exclusion>
		  </exclusions>
		</dependency>
		<dependency>
		  <groupId>com.harmony.apportal</groupId>
		  <artifactId>harmony-client</artifactId>
		  <version>2.3</version>
		  <exclusions>
		  	<exclusion>
		  		<artifactId>log4j</artifactId>
		  		<groupId>log4j</groupId>
		  	</exclusion>
		  </exclusions>
		</dependency> 
	    <dependency>
	      <groupId>org.apache.struts</groupId>
	      <artifactId>struts2-spring-plugin</artifactId>
	      <version>${version.org.apache.struts}</version>
	      <type>jar</type>
	      <scope>compile</scope>
	      <exclusions>
	        <exclusion>
	          <groupId>org.springframework</groupId>
	          <artifactId>spring-beans</artifactId>
	        </exclusion>
	        <exclusion>
	          <groupId>org.springframework</groupId>
	          <artifactId>spring-context</artifactId>
	        </exclusion>
	        <exclusion>
	          <groupId>org.springframework</groupId>
	          <artifactId>spring-web</artifactId>
	        </exclusion>
	        <exclusion>
	        	<artifactId>javassist</artifactId>
	        	<groupId>javassist</groupId>
	        </exclusion>
	      </exclusions>
	    </dependency>
	    <dependency>
	      <groupId>taglibs</groupId>
	      <artifactId>standard</artifactId>
	      <version>1.1.2</version>
	      <type>jar</type>
	      <scope>compile</scope>
	    </dependency>
	    <dependency>
	      <groupId>javax.servlet</groupId>
	      <artifactId>jstl</artifactId>
	      <version>1.1.2</version>
	      <type>jar</type>
	      <scope>compile</scope>
	    </dependency>
	    
		<dependency>
		  <groupId>com.alibaba</groupId>
		  <artifactId>dubbo</artifactId>
		  <version>2.5.3</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>
		  <exclusions>
		  	<exclusion>
		  		<artifactId>log4j</artifactId>
		  		<groupId>log4j</groupId>
		  	</exclusion>
		  </exclusions>
		</dependency>
		<dependency>
		  <groupId>org.apache.zookeeper</groupId>
		  <artifactId>zookeeper</artifactId>
		  <version>3.4.4</version>
		  <exclusions>
		  	<exclusion>
		  		<artifactId>log4j</artifactId>
		  		<groupId>log4j</groupId>
		  	</exclusion>
		  </exclusions>
		</dependency>
	    <dependency>
	      <groupId>com.oracle</groupId>
	      <artifactId>ojdbc14</artifactId>
	      <version>10.2.0.4.0</version>
	      <scope>runtime</scope>
	    </dependency>
		<dependency>
		  <groupId>org.slf4j</groupId>
		  <artifactId>slf4j-api</artifactId>
		  <version>1.6.2</version>
		</dependency>
	    <!-- MySql -->
	    <!--
	    <dependency>
	      <groupId>mysql</groupId>
	      <artifactId>mysql-connector-java</artifactId>
	      <version>5.1.17</version>
	      <scope>runtime</scope>
	    </dependency>
	    -->
	    <!-- SQLServer - JTDS -->
	    <!--
	  	<dependency>
		  <groupId>net.sourceforge.jtds</groupId>
		  <artifactId>jtds</artifactId>
		  <version>1.2.4</version>
	      <scope>runtime</scope>
		</dependency>
	    -->
	    <dependency>
	    	<groupId>javax.servlet</groupId>
	    	<artifactId>servlet-api</artifactId>
	    	<version>2.3</version>
	    </dependency>
	    <dependency>
	    	<groupId>org.springframework</groupId>
	    	<artifactId>spring-tx</artifactId>
	    	<version>3.0.5.RELEASE</version>
	    	<type>jar</type>
	    	<scope>compile</scope>
	    </dependency>
	  </dependencies>
  <build>
    <finalName>civilaffairs</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${version.maven-checkstyle-plugin}</version>
        <configuration>
          <configLocation>config/sun_checks.xml</configLocation>   
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>${version.findbugs-maven-plugin}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.7.2</version>
        <configuration>
          <testFailureIgnore>true</testFailureIgnore>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${version.maven-checkstyle-plugin}</version>
        <configuration>
          <!-- your example configuration here -->
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>${version.findbugs-maven-plugin}</version>
        <configuration>
          <xmlOutput>true</xmlOutput>
          <threshold>High</threshold>
          <effort>Default</effort>
          <relaxed>true</relaxed>
          <findbugsXmlOutput>true</findbugsXmlOutput>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
  
  <modules>
  	<module>system_datacenter</module>
  	<module>system_mis</module>
  	<module>system_onduty</module>
  	<module>system_plan</module>
  	<module>system_reconstruction</module>
  	<module>system_evaluation</module>
  	<module>system_funds</module>
  	<module>system_supplies</module>
  	<module>system_cds</module>
  	<module>system_ads</module>
  	<module>system_demo</module>
    <module>framework_springtags</module>
    <module>system_common</module>
  </modules>
</project>
  • 打赏
  • 举报
回复
相关推荐
发帖
Web 开发
加入

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2013-01-22 02:35
社区公告
暂无公告