Some of my users have trouble accessing our local Nexus repository. Some of them are somewhat newbies in maven configuration. Sure they can test if everything is downloading fine running mvn install
, but I'd like to help them to isolate their environment problems.
Is there a simple mvn command just to test if the repository access is correctly configured?
1) Just run command mvn --version . Go to maven installation directory and view the content of settings. xml file under conf folder. It should tell you which maven central repository is being used.
mvn test-compile: Compiles the test source code. mvn test: Runs tests for the project. mvn package: Creates JAR or WAR file for the project to convert it into a distributable format. mvn install: Deploys the packaged JAR/ WAR file to the local repository.
mvn clean This command cleans the maven project by deleting the target directory.
Running 'mvn clean install' will run the default build. As specified above integration tests will be ignored. Running 'mvn clean install -P integration-tests' will include the integration tests (I also ignore my staging integration tests).
Use
mvn help:effective-settings
A simple
mvn clean
test the repository access.
I had a number of dependencies that failed to download from the Maven Central repository (apparently due to network throttling/flakiness). Running "mvn clean" just immediately returned with the same errors, obviously not attempting any more downloads. But its message said to rerun with "-x" option to see the full stack trace, so I ran:
mvn clean -x
This caused it to retry and download more. It took several tries to get all dependencies downloaded, but it did eventually run to completion. It didn't give me any stack traces, and I still don't know what was causing the failures (the repository was reachable the whole time).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With