1. Preface
In development often to build a Maven sub-project, for students without templates from the Java project to convert is also a good choice. This article provides an introduction to how to create a MAVEN project from a Java project, and I believe it is helpful to transform a Java project into a MAVEN project.
2. Create a Java project.
Create a Java project as shown in:
3. Convert to Maven project.
Select Convert to Maven project, Configure, right-click this project. The following information about the sky can be seen:
Click Finish and then this project directory will produce a pom.xml file, such as:
4. Configure the parent project of the Pom.xml.
To add the configuration of the parent section in the Pom.xml file, the configuration of this section is as follows:
<parent> <groupId>com.alu.dashboard.common</groupId> <artifactId>qosac.dashboard.common</artifactId> <version>${module_version}</version> </parent> |
5. Transform the project.
Open the catalog for this project and delete all folders and files except SRC and pom.xml:
6. Build the directory.
Create the main and test two directories under SRC, and then create the Java directories under the two directories respectively. Build the resources directory below Src/main.
7. Re-import the modification works.
Re-import the project in Eclipse and import it using Maven-Existing maven module. Once the project has been built, it has become a standard MAVEN project.
8. Summary
The work of the Web project to MAVEN Web module is similar, and if necessary I will describe the process of its transformation in a future article.
Java Engineering converted to MAVEN project-B