Maven3 项目创建设置
2015-12-27 23:21
239 查看
New Project
For this example I will be using Eclipse for my IDE.Download Eclipse IDE for Java EE Developers from http://www.eclipse.org/downloads/
Unzip the contents in your root Eclipse folder. In my case I unzipped it in c:/java/eclipse
Run the ‘eclipse.exe’ in [eclipse root]/eclipse
Select a workspace location for Eclipse to store your projects. In my case I used the default location
Click on the ‘Workbench’ icon
Select Help -> Install New Software
Click the ‘Add…’ button
Name: m2eclipse
Location: http://m2eclipse.sonatype.org/sites/m2e
Click ‘OK’
Check the ‘Maven Integration for Eclipse’ option
Click ‘Next’
Click ‘Next >’
Select ‘I accept the terms of the license agreements’
Click ‘Finish’
Click ‘Restart Now’
Select Window -> Preferences
Add the Maven 3 location the you installed earlier
Create a new Maven project by selecting File -> New -> Other…
Select Maven -> Maven Project
Check ‘Create a simple project (skip archetype selection)’
Click ‘Next >’
Enter Project Information
Enter Group Id. This is the domain where the project is hosted. For example if the ‘Awesome’ project was hosted at GitHub then the Group Id would be ‘com.github.awesome’.
Enter Artifact Id. This is the name of the resulting artifact. For example if Artifact Id is ‘awesome’ and the packaging is JAR the artifact will be named ‘awesome.jar’.
The version can remain 0.0.1-SNAPSHOT
Select the packaging that you desire
Enter a Name. This name will show up in the console when you run Maven. This will also show up in the documentation that Maven generates
Enter a Description. This is used in the documentation
Click ‘Next >’
Add a dependency on JUnit. One of the best features of m2eclipse plugin is the ability to search for available dependencies. (This feature does not work if you configure ‘M3_HOME’ instead of ‘M2_HOME’)
Click ‘Finish’
src – source and resource files
target – compiled files, reports and generated artifacts
main – application/library files
test – test files
java – java files
resources – non java files like XML
Maven’s default package structure:
Open the pom.xml file.
Add the compiler plugin so you can configure your JDK version. Search for the maven-compiler-plugin.
For this example set the JDK version to 1.6
<configuration> <source>1.6</source> <target>1.6</target> </configuration> |
The build was successful
maven需要的jar下载
相关文章推荐
- 一些话语
- 复杂和遗留的数据库schema
- 复杂和遗留的数据库schema
- java servlet+mysql全过程(原创)
- android应用安装之后删除apk
- 检查OSD哪些配置有别于默认配置
- CheckedTextView
- [Python标准库]weakref——对象的非永久引用
- 面试题_93_to_102_编程和代码相关的面试题
- 进程管理及性能监控工具:PS/Top/Htop/Dstat
- yum rpm命令
- ICE 迁移64位安装问题
- ListView的复用->购物车,listView的布局复用->聊天窗口
- android中的category(调用系统工具等)
- Java toString() method
- 【跟我学spring 4.0 】之第六节-spring中scope作用域
- HTML 思维导图 2 CSS 部分
- 面试题_89_to_92_单元测试 JUnit 面试题
- OpenCV学习笔记(20)Kinect + OpenNI + OpenCV + OpenGL 组合体验
- git使用