使用mven编译apache-shiro出错
2016-03-24 21:54
961 查看
使用maven编译shiro-samples时报错:
[html] view
plain copy
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:
1.1:toolchain (default) on project shiro-samples: Cannot find matching toolchain
definitions for the following toolchain types:
[ERROR] jdk [ vendor='sun' version='1.6' ]
[ERROR] Please make sure you define the required toolchains in your ~/.m2/toolch
ains.xml file.
这是因为shiro-root-1.2.4.pom中使用了maven-toolchains-plugin,而maven中没有配置toolchain导致无法编译(toolchain可以指定编译时使用的jdk版本),见shiro-root-1.2.4.pom中的maven-toolchains-plugin:
[html] view
plain copy
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>1.1</version>
<configuration>
<toolchains>
<jdk>
<version>1.6</version>
<vendor>sun</vendor>
</jdk>
</toolchains>
</configuration>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
意思是使用sun的1.6版本的JDK来编译项目,toolchain可以在%MAVEN_HOME%\conf\toolchains.xml中定义(也可以在repository目录下定义,如默认的${user.home}/.m2/目录):
[html] view
plain copy
<toolchain>
<type>jdk</type>
<provides>
<version>1.6</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>C:\Program Files\Java\jdk1.6.0_45</jdkHome>
</configuration>
</toolchain>
这里定义了1.6版本的JDK的目录,当然,你也可以定义多个toolchain。
ok,大功告成!
如果需要了解更多关于toolchain的信息,可以看这里:
http://maven.apache.org/guides/mini/guide-using-toolchains.html
[html] view
plain copy
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:
1.1:toolchain (default) on project shiro-samples: Cannot find matching toolchain
definitions for the following toolchain types:
[ERROR] jdk [ vendor='sun' version='1.6' ]
[ERROR] Please make sure you define the required toolchains in your ~/.m2/toolch
ains.xml file.
这是因为shiro-root-1.2.4.pom中使用了maven-toolchains-plugin,而maven中没有配置toolchain导致无法编译(toolchain可以指定编译时使用的jdk版本),见shiro-root-1.2.4.pom中的maven-toolchains-plugin:
[html] view
plain copy
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>1.1</version>
<configuration>
<toolchains>
<jdk>
<version>1.6</version>
<vendor>sun</vendor>
</jdk>
</toolchains>
</configuration>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
意思是使用sun的1.6版本的JDK来编译项目,toolchain可以在%MAVEN_HOME%\conf\toolchains.xml中定义(也可以在repository目录下定义,如默认的${user.home}/.m2/目录):
[html] view
plain copy
<toolchain>
<type>jdk</type>
<provides>
<version>1.6</version>
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>C:\Program Files\Java\jdk1.6.0_45</jdkHome>
</configuration>
</toolchain>
这里定义了1.6版本的JDK的目录,当然,你也可以定义多个toolchain。
ok,大功告成!
如果需要了解更多关于toolchain的信息,可以看这里:
http://maven.apache.org/guides/mini/guide-using-toolchains.html
相关文章推荐
- 3. apache 调优
- Apache 配置二级域名匹配目录及多个站点配置 +阿里云服务器如何解析添加二级域名
- 如何配置Apache虚拟主机?(基于IP、基于端口、基于域名)
- apache几种限制ip的方法
- 在Apache中使用mod_rewrite模块重写URL
- apache 列目录修复
- Dbcp2抛出org.apache.commons.dbcp2.LifetimeExceededException
- hadoop windows下调试报错的分析org.apache.hadoop.io.nativeio.NativeIO$Windows
- Apache Maven 入门篇(下)
- Apache Maven 入门篇 ( 上 )
- Centos 6.6 在LAMP环境 Apache配置vhost
- Apache配置基于域名的虚拟主机
- Cannot load php5apache2_4.dll into server解决办法;
- wamp安装后,apache访问出现403
- 编译安装apache2.4.18遇到的问题以及解决办法
- Apache 创建虚拟主机目录和设置默认访问页面
- 持续集成篇_03_svn版本管理系统的使用(centos+subversion+apache+jsvnadmin+tortoisesvn)
- org.apache.commons.lang.StringUtils(StringUtils工具类的常用方法)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误解决方法
- linux(centos7)+apache+php7 安装教程