使用IDE与maven建立工程-1
2012-11-06 12:18
471 查看
一 、新建project
二、建立好的工程如下
.iml文件解释如下
刚建立好的工程中pom.xml的内容如下
Ø project:pom.xml文件中的顶层元素;
Ø modelVersion:指明POM使用的对象模型的版本。这个值很少改动。
Ø groupId:指明创建项目的组织或者小组的唯一标识。GroupId是项目的关键标识,典型的,此标识以组织的完全限定名来定义。比如,org.apache.maven.plugins是所有Maven插件项目指定的groupId。
Ø artifactId:指明此项目产生的主要产品的基本名称。项目的主要产品通常为一个JAR文件。第二,象源代码包通常使用artifactId作为最后名称的一部分。典型的产品名称使用这个格式: <artifactId>- <version>. <extension>(比如:myapp-1.0.jar)。
Ø version:项目产品的版本号。Maven帮助你管理版本,可以经常看到SNAPSHOT这个版本,表明项目处于开发阶段。
Ø name:项目的显示名称,通常用于maven产生的文档中。
Ø url:指定项目站点,通常用于maven产生的文档中。
Ø description:描述此项目,通常用于maven产生的文档中。
对于一个项目中只有下面的一部分是是我们需要关注的:
<groupId>com.chongshi.test</groupId>
<artifactId>hello</artifactId>
<version>1.0</version>
三、新建一个java类
新建一个com.test.model.Hello.java
使用右边的 maven Project
第一次使用时一定要先使用clean 再使用compile
编译之后的文件目录如下,多出一个target文件夹
二、建立好的工程如下
.iml文件解释如下
Goal | Description |
---|---|
idea:clean | Removes all existing IDEA files for the project. |
idea:help | Display help information on maven-idea-plugin. Callmvn idea:help -Ddetail=true -Dgoal=<goal-name> to display parameter details. |
idea:idea | Goal for generating IDEA files a POM. This plug-in provides the ability to generate project files (.ipr, .iml and .iws files) for IDEA. |
idea:module | Creates the module files (*.iml) for IntelliJ IDEA. |
idea:project | Creates the project file (*.ipr) for IntelliJ IDEA. |
idea:workspace | Creates the workspace file (*.iws) for IntelliJ IDEA. |
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>testOne</groupId> <artifactId>testOne</artifactId> <version>1.0</version> </project>
Ø project:pom.xml文件中的顶层元素;
Ø modelVersion:指明POM使用的对象模型的版本。这个值很少改动。
Ø groupId:指明创建项目的组织或者小组的唯一标识。GroupId是项目的关键标识,典型的,此标识以组织的完全限定名来定义。比如,org.apache.maven.plugins是所有Maven插件项目指定的groupId。
Ø artifactId:指明此项目产生的主要产品的基本名称。项目的主要产品通常为一个JAR文件。第二,象源代码包通常使用artifactId作为最后名称的一部分。典型的产品名称使用这个格式: <artifactId>- <version>. <extension>(比如:myapp-1.0.jar)。
Ø version:项目产品的版本号。Maven帮助你管理版本,可以经常看到SNAPSHOT这个版本,表明项目处于开发阶段。
Ø name:项目的显示名称,通常用于maven产生的文档中。
Ø url:指定项目站点,通常用于maven产生的文档中。
Ø description:描述此项目,通常用于maven产生的文档中。
对于一个项目中只有下面的一部分是是我们需要关注的:
<groupId>com.chongshi.test</groupId>
<artifactId>hello</artifactId>
<version>1.0</version>
三、新建一个java类
新建一个com.test.model.Hello.java
使用右边的 maven Project
第一次使用时一定要先使用clean 再使用compile
编译之后的文件目录如下,多出一个target文件夹
相关文章推荐
- 使用maven建立WEB工程
- 使用maven建立SpringMVC工程
- 使用Java web工程建立Maven Web Module工程
- Myeclipse2012下 使用maven 建立web工程的3种方法
- 使用Maven构建Java工程(Building Java Projects with Maven)
- idea使用maven创建web工程
- 使用Maven构建一个简单的java工程
- maven在eclipse建立工程,运行出现Server IPC version 9 cannot communicate with client version 4错误
- 使用vc++建立一个utility工程
- 建立和使用Maven项目骨架Archetype
- Win7下使用maven远程部署工程至CentOS的Tomcat6
- eclipse使用maven,启动工程tomcat报错:java.lang.ClassNotFoundException: org.springframework.web.context.Contex
- 使用HAL库函数建立STM32F2工程笔记
- Maven2 根据项目生成模版项目,并使用该模板批量创建工程。
- ubuntun 下使用QTcreator作为IDE建立arm-linux交叉编译环境
- 建立一套完整的Maven依赖工程步骤,包含WEB工程
- 使用maven建立WEB工程
- Vivado2015.4使用教程(一个完成工程的建立)
- 使用myeclipse建立maven项目(重要)
- 工程需要建立成maven工程,然后打包输出