The project wanted to download a dependency, but I couldn’t even get it down in IDEA. After checking various solutions on the Internet, there was no effect, so I used the command to download and import it into maven repository

Commands like this: MVN install: install-file-dfile =d:\setup\ dubo-2.8.4. jar -dgroupid =com.alibaba -DartifactId= dubo-dversion =2.8.4 -Dpackaging=jar

For example:

	   <dependency>
		   <groupId>net.sf.json-lib</groupId>
		   <artifactId>json-lib</artifactId>
		   <version>2.4</version>
	   </dependency>
Copy the code

The one above is the dependency I want to download

Let’s go to central warehouse and pack. Here I put the downloaded package in the Setup folder

Use CMD to open the command line and enter MVN install: install-file-dfile =d:\setup\json-lib-2.4-jdk15.jar -dgroupid =net.sf.json-lib -dartifactid =json -lib-dversion =2.4 -dpackaging =jar

Here’s another example:

Map for me in the type string, json type, type conversion, besides fastjson dependence and the reliance of the above, but the runtime error again. Java lang. ClassNotFoundException: net. Sf. Ezmorph. Morpher

Cause analysis: In addition to importing the jSON-lib-2.2-jdk15.jar package, there are several dependencies: Commons-beanutils. jar, commons-httpclient.jar, commons-lang. Jar, ezmorph.jar, morph-1.0.1.jar The above exception occurs if the ezmorph.jar package inside is missing. Workaround: Add dependencies to POM.xml:

Ezmorph

ezmorph


1.0.6
So there’s another dependency

Go to the warehouse service maven.aliyun.com/mvn/search

Looking for a

Download the JAR package and place it in the setup folder (name it yourself) that corresponds to the command

Run CMD to open the command window and enter the following command:

MVN install: install-file-dfile =d:\setup\ezmorph-1.0.6.jar -dgroupid =net.sf. ezmorph-dartifactid = ezmorph-dversion =1.0.6 -Dpackaging=jar

If this comes up

Take a close look at your command: my command is net.sf. ezmorph-dartifactid with a space before –

There is no problem with compile MVN package.

Failed to execute goal org, apache maven. Plugins: maven – surefire plugin: 2.5: test

Solutions: MVN clean package-dmaven.test. skip=true
org.apache.maven.plugins


maven-surefire-plugin


2.4.2



true

Adds dependencies to the project’s PEM.xml

If this comes up

It means it’s done

For example:

MVN install: install – file – Dfile = d: \ setup \ Commons beanutils – 1.9.2. The jar – DgroupId = Commons beanutils. – – DartifactId = Commons beanutils – Dversion = 1.9.2 – Dpackaging = jar