11.18. Maven Eclipse

发布时间 :2025-10-25 12:23:17 UTC      

Eclipse provides a good plug-in m2eclipse The plug-in integrates Maven and Eclipse

Maven is included in the latest Eclipse. We open it, Windows- > Preferences. If the following screen appears:

image0

Here are some of the features of m2eclipse:

  • You can run the target file of Maven on the Eclipse environment.

  • You can use its own console to view the output of the Maven command directly in Eclipse.

  • You can update the dependency of Maven under IDE.

  • You can use Eclipse to build Maven projects.

  • Eclipse is based on Maven’s pom.xml to automate dependency management.

  • It solves the dependency between the workspace of Maven and Eclipse without the need to install to the local Maven repository (depending on the project in the same workspace).

  • It can automatically download the required dependencies and source code from the remote Maven library.

  • It provides wizards to create new Maven projects, pom.xml, and enable Maven support on existing projects.

  • It provides a quick search for dependencies of remote Maven repositories.

11.18.1. Import a Maven project in Eclipse

  • Open Eclipse

  • Choice File > Import > option

  • Select the Maven Projects option. Click the Next button.

image1

  • Select the path to the project, that is, the storage path when you create a project using Maven. Suppose we create a project: consumerBanking. Pass through Maven 构建 Java 项目 See how to create a project using Maven.

  • Click the Finish button.

image2

Now, you can see the Maven project in Eclipse.

image3

Looking at the properties of the consumerBanking project, you can see that Eclipse has added everything that Maven depends on to its build path.

image4

All right, let’s use Eclipse’s compilation capabilities to build the Maven project.

  • Right-click to open the context menu of the consumerBanking project

  • Select the Run option

  • Then select the maven package option

Maven starts building the project, and you can see the output log in the Eclipse console.

[INFO] Scanning for projects...
[INFO] -------------------------------------------------------------------
[INFO] Building consumerBanking
[INFO]
[INFO] Id: com.companyname.bank:consumerBanking:jar:1.0-SNAPSHOT
[INFO] task-segment: [package]
[INFO] -------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] Surefire report directory:
C:\MVN\consumerBanking\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.companyname.bank.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.047 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] [jar:jar]
[INFO] -------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] -------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Thu Jul 12 18:18:24 IST 2012
[INFO] Final Memory: 2M/15M
[INFO] -------------------------------------------------------------------

image5

Now, right-click App.java , select Run As Options. Choice As Java App

You will see the following results:

Hello World!
Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.