Perfect Combination of Maven and IntelliJ IDEA, mavenintellij

Source: Internet
Author: User

Perfect Combination of Maven and IntelliJ IDEA, mavenintellij

Are you learning Maven? Is it because Maven is difficult to use and has to be used? Are you confused about the conflicts between Eclipse and Maven?

So I will tell you a more direct and simpler solution: IntelliJ IDEA!

What is Maven? Why Maven instead of Ant?

Maven is a project management tool and is considered a substitute or successor of Ant. In fact, Maven features far exceed Ant. It not only provides compiled scripts, but also provides test, release, document generation and other functions throughout the project cycle, and has a unique dependency management method. However, the cost of powerful functions is complicated usage. It usually takes nearly half an hour (domestic network speed) to download a local dependent library for the first time to use Maven, this will undoubtedly make it difficult for many developers to leave ". Despite the widespread criticism, Maven gradually replaced Ant and became a necessary skill for Java developers.


IntelliJ IDEA and Eclipse

In the world of Java, Eclipse is undoubtedly the leader in IDE. IntelliJ IDEA and NetBeans can only live in the halo of Eclipse. I don't need to talk about the power of Eclipse, but IntelliJ IDEA is actually a very good IDE, especially in its intelligence. Its Clone product ReSharper for. Net has been accepted by more and more C # developers. IntelliJ IDEA provides a large number of intelligent rules to help developers, such as code completion, usage conversion, format prompts, etc. When you get used to it, you will love the light bulb.


Why Maven + IntelliJ IDEA

IntelliJ IDEA is selected because Maven + Eclipse is too difficult to use. Eclipse has two Maven plug-ins: m2eclipse and Eclipse IAM. However, due to the conflict between Eclipse and Maven design, these two plug-ins may not achieve the desired effect. M2eclipse will treat all your types of projects as Maven projects, which may be a simple Java project and a disaster for a JEE or WEB project. Eclipse IAM does not change the type of your project, but its functions are limited to editing and running POM files, and even dependency management is impossible. In contrast, if you have to use Eclipse, I recommend that you use Eclipse IAM. To perfectly support Maven, Eclipse may need to make some changes in the underlying design. Both code specifications, project structure specifications, and dependency management have irreconcilable conflicts. Obviously, IntelliJ IDEA is much better in this aspect, so it is hard to say that you are not satisfied with it.

Let's take a look at the advantages of Maven + IntelliJ IDEA:

Everything is Module:

IntelliJ IDEA draws on the Maven concept and does not adopt the Project concept in Eclipse. Everything is a Module. Whether or not Maven is used, your project is an independent Module. In addition, you can use Maven Module and common Java Module to mix and match. The two can coexist harmoniously.

Multi-module supported:
It can be said that the Maven project structure design is very strict, and you must use the Parent-Child mode in practical applications. Eclipse does not support creating Sub-projects on a Project, so it cannot be implemented at any time. IntelliJ IDEA can perfectly implement this design, and there will be no problems in both Module attributes and their dependencies.

More convenient lifecycle operations:

IntelliJ IDEA has a separate window to complete Maven operations compared to the actions that Eclipse can put in the right-click menu. You can perform Clean Compile Package Install and other operations on different modules. Each Plug-in operation is clear.

Perfect dependency management:

Maven stores all dependent packages in a directory on the local machine, which is actually separated from the Project itself. IntelliJ IDEA introduces the concept of External Library, where all Maven dependencies are separated from the built-in project Library. In addition, modules are judged intelligently. You do not need Maven Install to update the referenced code.

Dynamic Update:

When Maven-related settings are changed, for example, if you modify the pom dependency and add or delete a Module, IntelliJ IDEA will prompt you to update it. This type of update is actually running Maven, so you are not allowed to manually run Maven Compile for updates, nor will you encounter any inexplicable problems like in Eclipse.


In general, IntelliJ IDEA supports Maven very well. It is also a very good IDE. If you are interested, try it.


What is java maven IntelliJ IDEA?

IntelliJ IDEA is an old java Development Tool. java is a programming language. maven is a comprehensive build tool.

Advantages and disadvantages of using intellij Idea + maven for java project development (compared with Myeclipse + tomcat)

IDE does not need to be compared, depending on your habits.
Maven and tomcat are not the same thing. maven is a project management tool and tomcat is a web Container. Therefore, you can use idea + tomcat + maven or myeclipse + tomcat + maven, of course, all three can be replaced with others, depending on the individual and project details.
The location of the compiled file is related to maven settings. If maven is not used, it is related to web containers.

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.