创建一个Maven 的父项目
新建一个maven项目,选中create a simple project
填写以下内容:
如下内容:
Group Id :edu.zipcloud.cloudstreetmarket Artifact Id :cloudstreetmarket-parent name:CloudStreetMarket parent
完成后资源管理器中会出现pom.xml文件,编辑该文件:
<project></project>最后写入
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.8</source> <target>1.8</target> <verbose>true</verbose> <fork>true</fork> <executable>$C:/Program Files/Java/jdk1.8.0_144/bin/javac</executable> <compilerVersion>1.8</compilerVersion> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.4.2</version> <configuration> <jvm>$C:/Program Files/Java/jdk1.8.0_144/bin/java</jvm> <forkMode>once</forkMode> </configuration> </plugin> </plugins> </build>
————————————————————————————————分界线——————————————————————————————————————————————————————
创建子模块:作为父项目的子模块
包装所有业务逻辑的模块web
ModuleName:cloudstreetmarket-webapp
Parene Projiect:cloudstreetmarket-parent
单击:Next
创建rest api模块
创建核心模块:
与上类似,第一个modulename:cloudstreetmarket core
第二个name:CloudStreetMarket Core
--------------------------------------------------------------------------------------------------------------------分界线-------------------------------------------------------------------------------------------------------------------------------------
创建公司特定项目及其模块
父项目
file --->new--->maven project--->选中create a simple...user default work...
填写pom.xml
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.8</source> <target>1.8</target> <verbose>true</verbose> <fork>true</fork> <executable>$C:/Program Files/Java/jdk1.8.0_144/bin/javac</executable> <compilerVersion>1.8</compilerVersion> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.4.2</version> <configuration> <jvm>$C:/Program Files/Java/jdk1.8.0_144/bin/java</jvm> <forkMode>once</forkMode> </configuration> </plugin> </plugins> </build>
核心模块
next-->packaging:jar,Name:ZipCloud Factory Core Business--->finish
----------------------------------------------------------------------------------------------------------------分界线-----------------------------------------------------------------------------------------------------------------------------------------------
运行项目
右键单击项目zipcloud-parent-->ran as -->maven clean
右键单击项目cloudstreetmarket-parent--->run as-->maven clean
run as --->maven install