关于Maven构建Appfues时出com.sun:tools:jar:1.5.0错的解决方法
在使用Maven构建Appfues时通常都会出现
- Missing:
- ----------
- 1) com.sun:tools:jar:1.5.0
- Try downloading the file manually from the project website.
Missing:
----------
1) com.sun:tools:jar:1.5.0
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的路径的
评论
<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>
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>