How to upload jar package after nexus 3.0

mvn deploy:deploy-file -DgroupId=com.example -DartifactId=demo -Dversion=1.0 -Dpackaging=jar -DrepositoryId=nexus -Dfile=C:\Users\Administrator\Desktop\demo.jar -Durl=http://192.168.59.2:8081/repository/maven-releases/ -DgeneratePom=false 

 

 

 

比如:mvn deploy:deploy-file -DgroupId=com.ccb -DartifactId=servlet -Dversion=1.0 -Dpackaging=jar -DrepositoryId=nexus -Dfile=C:\Users\Administrator\Desktop\VerifyAuth.jar -Durl=http://192.168.59.2:8081/repository/maven-releases/ -DgeneratePom=false

 

 

The nexus here corresponds to the setting.xml in the mvn configuration file

 

 

 

  <servers>
    <!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     |
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
     |       used together.
     |
    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
    -->

    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
    <server>
	    <id>nexus</id>
	    <username>admin</username>
	    <password>123456</password>
	</server>
  </servers>

 

 

It really doesn't work, you can use the compile plug-in in pom.xml to introduce the jar package


			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<encoding>UTF-8</encoding>
					<compilerArguments>
						<extdirs>src/main/lib</extdirs>
					</compilerArguments>
				</configuration>
			</plugin>

 

If you want to specify settings.xml

mvn -s D:\app\apache-maven-3.2.3\conf\settings.xml deploy:deploy-file
-DgroupId=com.abc.pay -DartifactId=client -Dversion=3.1.1 -Dpackaging=jar
-Dfile=C:\Users\dongsw\Desktop\client-3.1.1.jar
-Durl=http://192.168.59.240:8081/repository/maven-releases/ -DrepositoryId=releases

 

Example

mvn -s C:\Users\Administrator\.m2\settings.xml deploy:deploy-file -DgroupId=com.websocket.goeasy -Durl=http://maven.sxb.lol/repository/maven-releases/ -DartifactId=goeasy-sdk -Dversion=1.0.0  -Dpackaging=jar -Dfile=C:\Users\Administrator\Desktop\goeasy-sdk-0.3.5.jar -DrepositoryId=releases -X

 

Note that -DrepositoryId=release is the same as the server's id

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326074039&siteId=291194637