Using docker-compose to deploy Nexus in docker
-
run
docker-compose up -d
-
wait a few seconds and open your browser , and visit http://localhost:8081 , the account is admin , and password is admin123
- first of all , we need sign in as admin user , and than create a repository .
- choice maven2 repository
- plz pay attention , we need set repository's name and version policy and deployment policy.
- than , we need to create a user named liumapp (or some name else you like )
- set user's property
-
update your maven config file settings.xml
add content below :
<servers> <server> <id>liumapp</id> <username>liumapp</username> <password>liumapp</password> </server> </servers>
-
using commond :
mvn deploy:deploy-file -DgroupId=com.liumapp.convert.html -DartifactId=convert-html-to-pdf -Dversion=v1.0.0 -Dpackaging=jar -Dfile=./target/convert-html-to-pdf-v1.0.0.jar -Durl=http://127.0.0.1:8081/repository/liumapp/ -DrepositoryId=liumapp
to deploy your maven project .
or use
mvn deploy
but you will need update your pom file , add content below :
<distributionManagement> <repository> <id>liumapp</id> <url>http://127.0.0.1:8081/repository/liumapp/</url> </repository> </distributionManagement> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>2.2.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin>