Labels

Sunday, 19 January 2014

Maven - Troubleshooting

1. Re-download MAVEN repository: 
Only download repository dependency, not test the code.
  • mvn clean compile -DskipTests=true
2. Proxy - (In case proxy used in Workplace): 
   Note: Set Proxy first; then download repository
    2.1 Locate "Auto Proxy Script"
  • Control Panel/ Internet Options/ Connections Tab/ LAN Settings 
    2.2 Download "Proxy Data File"
    2.3 Select a proxy setting as below:
  • var some_id = "PROXY some_host.com:some_port";
    2.4 Now set proxy in settings.xml config file:
         Note: some one save it under .../.m2/ folder 
  • Open settings.xml from %M2_HOME%\conf directory
  • Edit settings.xml as below:
      <proxy>
              <id> some_id </id>
              <active> true </active>
              <protocol> http </protocol>
              <host> some_host </host>
              <port> some_port </port>
      </proxy>

3. Force Maven to Re-download A particular Repository
    When Maven encounters a problem and unable to download A repository --> We need to use this command to re-download that Repo after problem has been solved.

  • mvn dependency:purge-local-repository
4. Force Maven to Update dependencies
    Note: Used for update the jar files
  • mvn clean compile -U -DskipTests=true

No comments:

Post a Comment