When Maven builds a project, it may refer to other projects in some companies. Or a referenced jar package is not loaded in the MAVEN master repository.
We can then install the jar packages we need into the local repository. The method is as follows.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
The following commands for Maven to install the JAR pack are:
MVN Install:install-file-dfile=jar Package Position-dgroupid= Upper groupid-dartifactid= above artifactid-dversion= above version- Dpackaging=jar
For example:
The jar package I downloaded was placed in the D:\MVN directory (D:\mvn\spring-context-support-3.1.0.RELEASE.jar)
Then the command I typed in cmd should be:
MVN install:install-file-dfile=
D:\mvn\spring-context-support-3.1.0.RELEASE.jar-dgroupid=
org.springframework-dartifactid=
Spring-context-support-dversion=
3.1.0.RELEASE-dpackaging=
Jar
Of course, you can also add directly to the project:
<dependency>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
<version>1.3.10</version>
<scope>
system</scope>
<systemPath>
${project.basedir}/src/main/webapp/web-inf/lib/javabuilder.jar</systemPath>
</dependency>
PS: When using MAVEN to package, this method does not break into the deployment package a jar with the system scope.
From http://www.tmser.com/post-177.html