Eclipse is currently the most popular Java, J2EE development environment, because it is open-source free, we will first talk about how to use Maven in eclipse, another commercial IDE, I think intellij idea, which is more user-friendly and functional than eclipse, is the current version of 8.1, which is also an IDE that I have always admired and used over the years, I will also introduce how to use it in idea, which is relatively simple.
InEclipseUseMaven
Using Maven in eclipse is implemented through the plug-in named m2e. before talking about how to use it, Let's briefly talk about the features of m2e:
- Check out a project from SCM
- Use predefined archetype to create a project
- Create a Maven Module
- Import Maven Project
- M2eclipse has the POM editor, so you do not need to manually edit the Pom.
- M2eclipse built-in search function for central Maven Repository
- The dependency tree function allows you to conveniently view dependencies between jar packages.
With these features, you can easily start developing your Maven project in eclipse Without tedious commands. Just click the wizard step by step.
InstallM2e
In eclipse, select software updates from the Help menu. In the software updates and add-ons dialog box, click the available software button, and then click Add site to add the updated site URL: http://m2eclipse.sonatype.org/sites/m2e. After you add this URL, you will be able to add Maven integration, Maven optional components, and Maven project configurators to your project.
SlaveMaven ArchetypeCreateMavenProject
Maven Archetype is a project template. The Maven repository contains many archetype types, from web applications to Message Components. With m2eclipse, it is very easy to use Maven archetype. To create a Maven project using mavenarchetype, select File> New> project... And then input Maven in the filter field. Select a new Maven project and click Next. The next screen provides an interface for you to select the mavenarchetype for the new project.
Search for dependencies and components
Quick Searching and locating of Dependencies from the maven repository can greatly save time. With m2eclipse, you no longer need to find a central repository for components of a version. If you need to add a component to the maven project, right-click the project and select Add dependency under the maven menu. Then, you will see the dialog box as shown in. Simply entering groupid and artifactid will allow m2eclipse to search for the Nexus index of a Maven repository and display matched components. Quick component Locating means that you no longer need to spend countless times in the maven repository to find a specific dependent component.
Analysis dependency tree
M2eclipse provides some interesting functions for you to analyze and draw charts on Project dependencies. You can click the project Pom. XML to load the POM editor. If you open a project with many dependencies, you can click the dependency tree Tab Of the POM editor and see the dependency display.
If you want to view dependencies in graphs, click the dependency graph tab to view the project dependency graph. Click a node in the figure to highlight the node and emphasize the relationship between the component and other components in the project dependency.