为Maven指定JDK以供使用 [英] Specify JDK for Maven to use

查看:156
本文介绍了为Maven指定JDK以供使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个我修改过的Hudson插件,它需要jdk1.6。这很好,但我不知道如何告诉maven不同的jdk在哪里。我在互联网上发现很少提及,但它们似乎并不适用于我。有人建议在 .m2 / settings.xml 中添加一些配置,但我没有 settings.xml 。另外,我不想对所有maven版本使用1.6。

I am trying to build a Hudson plugin I've modified and it requires jdk1.6. This is fine, but I don't see how I can tell maven where the different jdk is. I've found few mentions on the internet but they don't seem to apply to me. Some suggest adding some config to .m2/settings.xml but I don't have a settings.xml. Plus, I don't want to use 1.6 for all maven builds.

一个问题是我在cygwin中使用 mvn ,如果这很重要的话。看来我应该能够在项目pom文件中制作规范,但是现有的pom非常简单。

One kink is I am using mvn in cygwin, if that matters at all. It appears I should be able to make the specification in the project pom file, but the existing pom is pretty bare.

所以底线是,有没有办法为maven的单个调用指定一个jdk?

So bottom line is, is there a way to specify a jdk for a single invocation of maven?

推荐答案


所以底线是,有没有办法为maven的单个调用指定一个jdk?

So bottom line is, is there a way to specify a jdk for a single invocation of maven?

暂时更改 JAVA_HOME

这篇关于为Maven指定JDK以供使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆