Upload Artifacts Using the Maven Command-Line Interface
You can also use the Maven command-line interface to upload artifacts to the project’s Maven repository.
The Maven repository URL is available on the Project Home page of your project. Use the dav: URL to upload files and the http:// URL to view them in the browser.
Note that the credentials in settings.xml aren’t required to access the project Maven repository when running a build. The build job has full access to the project Maven repository for uploads and downloads.
-
Download and install Maven on your local computer. You can download Maven from
http://maven.apache.org/download.cgi. -
Open
MVN_HOME/conf/settings.xmlin a text editor and make the following changes.-
Specify the proxy server, if necessary.
Example:
<proxies> <proxy> <active>true</active> <protocol>http</protocol> <host>PROXY_URL</host> <port>80</port> <nonProxyHosts>www.anything.com|*.somewhere.com</nonProxyHosts> </proxy> </proxies> -
Specify a unique ID and your VB Studio user name and password to access the project Maven repository.
Example:
<servers> <server> <id>remoteRepository</id> <username>USERNAME</username> <password>PASSWORD_IN_PLAINTEXT</password> </server> </servers> -
Specify a unique ID, name, and URL for the project Maven repository. You can copy the Maven repository URL from the Repositories tab of the Project Home page.
Example:
<profiles> <profile> <id>default</id> <repositories> <repository> <id>remoteRepository</id> <name>My Remote Repository</name> <url>dav:https://developer.us2.oraclecloud.com/……/maven/</url> <layout>default</layout> </repository> </repositories> </profile> </profiles>
-
-
Open the command-line and follow these commands to upload files to the hosted Maven repository. Ensure that the
MVN_HOME/binpath is available in thePATHvariable.-
Navigate to the directory that contains the files that you want to upload.
-
Create the
pom.xmlfile, if it hasn’t been created already. For more information aboutpom.xml, seehttp://maven.apache.org/guides/introduction/introduction-to-the-pom.html. -
Run the
mvn deploycommand to upload files. Example:mvn deploy:deploy-file -DpomFile=c:\myproject\pom.xml -Dfile=c:\myproject\myfile.jar -DrepositoryId=remoteRepository -X -Durl=dav:https://developer.us2.oraclecloud.com/……/maven/
-