创建一个新的Maven project:
确保Create a simple project的勾不enable:
选择quickstart作为template:
维护groupID, Artifact ID和version. 这三个元素在repository能唯一确定一个artifact:
创建后之后会自动生成pom.xml:
创建一个java class:
Run as ->Maven, goal选成compile:
compile成功:
goal选择成install之后:
install失败,error message提示需要使用JDK提供的javac compiler:
Unable to locate the Javac Compiler in: c:\Program Files\Java\jre7…\lib\tools.jar
设置环境变量:
将Eclipse使用的JRE替换成JDK:
之后install成功:
在local repository里能够观察到install成功的jar包:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":