Pom.xml configuration for automatically downloading jar packages in MAVEN projects
With maven2, the dependency is set inPom. XML and will help you to download all dependencies. The directory that the jar to M2_repo points to
--------------------------------------------------------------------------------------------
M2_repo is a storage location used to define the MAVEN 2 repository on the hard disk, and Windows defaults to the C:\Users\ machine name \.m2\repository. The M2eclipse plug-in is installed with the appropriate settings in eclipse.
If the M2eclipse plugin is not installed, Eclipse opens the MAVEN project and may error, this time you need to manually set M2_repo.
How to set it up:
Eclipse->windows->preferences->java->build Path->classpath Variables
New one, named M2_repo, property Select Folder, default path C:\Users\ machine name \.m2\repository
Once you've made such a setup, Eclipse integrates MAVEN functionality, and if you add a new dependent jar package in Pom.xml, perform mvn eclipse:eclipse and then refresh workspace at the root of the project. The newly-dependent jar package is added to the project's build path.
The above is the role of M2_repo.
---------------------------------------------------------------------------------------------
Use the MAVEN command to move the jar package to Maven's local repository
MVN Install:install-file-dfile=webapps\root\web-inf\lib\jaas.jar-dgroupid=javax.security-dartifactid=jaas- Dversion=1.0.01-dpackaging=jar
The following points need to be noted.
1. Note "-" must not be missing the "-" after the install is no space
2. Note the path of the jar package in "-dfile" and the name of the jar package.
3. Note The cmd command prompt to see if the jar package was successfully replicated in the local repository.
Pom.xml configuration for automatically downloading jar packages in MAVEN projects