maven---com.sun:tools:jar:1.5.0

来源:互联网 发布:打棒球的好处 知乎 编辑:程序博客网 时间:2024/04/28 09:24

关于Maven构建Appfues时出com.sun:tools:jar:1.5.0错的解决方法

在使用Maven构建Appfues时通常都会出现

Java代码 复制代码
  1. Missing:   
  2. ----------   
  3. 1com.sun:tools:jar:1.5.0  
  4.   
  5.   Try downloading the file manually from the project website.  

 
出现以上原因是因为jdk没有配好。我们只需要修改一个pom.xml就ok了
<!--jdk-->
  <dependency>  
          <groupId>com.sun</groupId>  
          <artifactId>tools</artifactId>  
          <version>1.6.0</version>  
          <scope>system</scope>  
          <systemPath>C:/Program Files/Java/jdk1.6.0_05/lib/tools.jar</systemPath>  
   </dependency>

 

注意<systemPath>${java.home}/../lib/tools.jar</systemPath>我们通常是使用系统的环境变量取得java.home的路径的

 

Jquery通过Json取得数据处理 | 如何使用Jmeter
  • 22:03
  • 浏览 (828)
  • 评论 (2)
  • 分类: 其他
  • 相关推荐
评论
2 楼 limeng1028 2009-01-12   引用
我在我的构建的pom中没有看到
  <dependency>  
          <groupId>com.sun</groupId>  
          <artifactId>tools</artifactId>  
          <version>1.6.0</version>  
          <scope>system</scope>  
          <systemPath>C:/Program Files/Java/jdk1.6.0_05/lib/tools.jar</systemPath>  
   </dependency>
1gordianyuan 2008-09-24   引用
http://maven.apache.org/general.html#tools-jar-dependency

How do I include tools.jar in my dependencies?

The following code includes tools.jar for JDKs on Windows, Linux and Solaris (it is already included in the runtime for Mac OS X and some free JDKs).

...
  <profiles>
    <profile>
      <id>default-tools.jar</id>
      <activation>
        <property>
          <name>java.vendor</name>
          <value>Sun Microsystems Inc.</value>
       </property>
     </activation>
      <dependencies>
        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.4.2</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
       </dependency>
     </dependencies>
   </profile>
</profiles>
信息来源http://gznofeng.javaeye.com/blog/239937
原创粉丝点击