Create a MAVEN multi-module project using IntelliJ idea 12

Source: Internet
Author: User
Tags jboss

When you use MAVEN to manage projects, you often need to create multiple modules, and there are mutually referenced relationships between the modules. For maven dependencies, there is also a need to create a module specifically to manage dependencies. For example, for a project, you can create a config module to manage Maven dependencies, create a common module to manage the Pojo class, create a server to manage the business logic and database operations classes, and create a Web module to organize Web files, such as html,jsp. is a MAVEN multi-module management case Project structure:

Simply say the creation process:

1. First create an empty project: Select Maven module on the left side of the Demo,new Project dialog box (the Module in idea corresponds to project in Eclipse), as shown in:

2. Select the template to create the project, you can not use the module, the created project will be more than the SRC directory, manually delete the SRC directory, or select a blank template (to use the template, you need to check "create from archetype"), directly create an empty project, The operation is as follows:

3. On the project name, right-click->new->module, fill in the Sub-project (module) name, select Maven Project, if it is not a Web module, you can use the template creation (that is, do not check "create from archetype"), General projects need to have SRC directory, src under Main and Test,main under the Java and Resources directory, Java class is placed in the Java directory.

4. Create a web directory is, you need to use the WebApp template, tick "Create from archetype", select the Maven-archetype-webapp template, such as:

Following these steps, a maven-managed multi-module (subproject) project structure is built. You can put the Maven dependencies you need to use in the Config module (subproject), and the other modules are referenced from config, as described in the Maven tutorials.

When you open a project, you can import the MAVEN project by using IntelliJ idea to directly open the Pom.xml file for the main project, as shown in the following:

IntelliJ idea in detail : please click here

IntelliJ Idea's : please click here.


<!--new Warehouses--
<repositories>
<repository>
<id>oschina releases</id>
<name>oschina releases</name>
<url>http://maven.oschina.net/content/groups/public</url>
</repository>
<repository>
<id>apache-repo</id>
<name>apache repository</name>
<url>https://repository.apache.org/content/groups/public/</url>
</repository>
<repository>
<id>java-repo</id>
<name>java repository</name>
<url>http://download.java.net/maven/2/</url>
</repository>
<repository>
<id>springsource-repo</id>
<name>springsource repository</name>
<url>http://repo.spring.io/release/</url>
</repository>
<repository>
<id>springsource-repo-snapshot</id>
<name>springsource repository</name>
<url>http://repo.spring.io/snapshot/</url>
</repository>
<repository>
<id>cloudhopper</id>
<name>repository for Cloudhopper</name>
<url>http://maven.cloudhopper.com/repos/third-party/</url>
</repository>
<repository>
<id>jboss-repo-releases</id>
<name>jboss repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
</repository>
<repository>
<id>central</id>
<name>maven Repository switchboard</name>
<layout>default</layout>
<url>http://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>maven-repo1</id>
<name>maven-repo1</name>
<layout>default</layout>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>sourceforge-releases</id>
<name>sourceforge releases</name>
<url>https://oss.sonatype.org/content/repositories/sourceforge-releases</url>
</repository>
</repositories>



Related reading:

IntelliJ idea: Font beautification (anti-aliased) and font additions http://www.linuxidc.com/Linux/2013-11/92609.htm

IntelliJ idea 12 Creating a Web project graphic detailed tutorial http://www.linuxidc.com/Linux/2013-05/84213.htm

Using IntelliJ idea to develop the Android program graphics tutorial http://www.linuxidc.com/Linux/2013-03/81471.htm

IntelliJ Idea 12 Development haxe NME application Configuration Guide http://www.linuxidc.com/Linux/2013-01/77227.htm

IntelliJ idea runs the play Framework test mode http://www.linuxidc.com/Linux/2013-07/87694.htm

Ubuntu 13.04 installation IntelliJ idea http://www.linuxidc.com/Linux/2013-11/93014.htm


Create a MAVEN multi-module project using IntelliJ idea 12

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.