Maven 2 & 3
  1. Maven 2 & 3
  2. MNG-4564

Location (and name) for settings-security.xml has changed in Maven 3

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0-alpha-6
    • Fix Version/s: 3.0-alpha-7
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP
      SUN JDK 1.6.0_16
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      Trying to encrypt server password (mvn --encrypt-password blabla) with Maven 3.0-alpha6 and having %USER_HOME%/.m2/settings-security.xml, I get a FileNotFoundException saying that %USER_HOME%/.settings-security.xml can't be found.

      Why has the name and location of this file change in Maven 3? It's not backwards compatible with Maven 2 as promised.

        Activity

        Hide
        Anders Hammar added a comment -

        Trying to do an actual deploy I see that the file has to be in %USER_HOME%/.m2/settings-security.xml. It seems as this is a bug in the encrypt-password functionality.

        Show
        Anders Hammar added a comment - Trying to do an actual deploy I see that the file has to be in %USER_HOME%/.m2/settings-security.xml. It seems as this is a bug in the encrypt-password functionality.
        Hide
        Benjamin Bentmann added a comment -

        Fixed in r912163.

        Show
        Benjamin Bentmann added a comment - Fixed in r912163 .
        Benjamin Bentmann made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 3.0-alpha-7 [ 16087 ]
        Resolution Fixed [ 1 ]
        Assignee Benjamin Bentmann [ bentmann ]
        Hide
        Peter Lynch added a comment -

        There appears to be some regression here

        I have a ~/.m2/settings-security.xml and am running maven 3.0-beta-1

        $mvn --version
        Using Java version: 1.6
        Apache Maven 3.0-beta-1 (r935667; 2010-04-19 13:00:39-0400)
        Java version: 1.6.0_20
        Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
        Default locale: en_US, platform encoding: MacRoman
        OS name: "mac os x" version: "10.5.8" arch: "x86_64" Family: "mac"
        
        $mvn nexus:staging-list -U -up
        Using Java version: 1.6
        [INFO] Scanning for projects...
        [INFO] snapshot org.sonatype.plugins:nexus-maven-plugin:1.3.2.2-SNAPSHOT: checking for updates from central
        [INFO]                                                                         
        [INFO] ------------------------------------------------------------------------
        [INFO] Building staging-test 1.0
        [INFO] ------------------------------------------------------------------------
        [INFO] 
        [INFO] --- nexus-maven-plugin:1.3.2.2-SNAPSHOT:staging-list (default-cli) @ staging-test ---
        [INFO] snapshot org.sonatype.nexus.restlight:nexus-restlight-stage-client:1.7.1-SNAPSHOT: checking for updates from central
        [INFO] snapshot org.sonatype.nexus.restlight:nexus-restlight-clients:1.7.1-SNAPSHOT: checking for updates from central
        [INFO] snapshot org.sonatype.nexus:nexus-clients:1.7.1-SNAPSHOT: checking for updates from central
        [INFO] snapshot org.sonatype.nexus:nexus:1.7.1-SNAPSHOT: checking for updates from central
        [INFO] snapshot org.sonatype.nexus.restlight:nexus-restlight-client-common:1.7.1-SNAPSHOT: checking for updates from central
        [INFO] snapshot org.sonatype.nexus.restlight:nexus-restlight-m2-settings-client:1.7.1-SNAPSHOT: checking for updates from central
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 2.444s
        [INFO] Finished at: Tue Jun 29 15:41:29 EDT 2010
        [INFO] Final Memory: 4M/265M
        [INFO] ------------------------------------------------------------------------
        [ERROR] Failed to execute goal org.sonatype.plugins:nexus-maven-plugin:1.3.2.2-SNAPSHOT:staging-list (default-cli) on project staging-test: Failed to discover Nexus instance. Failed to decrypt server password: {RA55TEClhiYHZqfMtX4PmGtXpDsVT0/tW2xgFNiL4u4=} deployment123 default: org.sonatype.plexus.components.sec.dispatcher.shaded.SecDispatcherException: java.io.FileNotFoundException: /Users/plynch/.settings-security.xml (No such file or directory) -> [Help 1]
        [ERROR] 
        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
        [ERROR] 
        [ERROR] For more information about the errors and possible solutions, please read the following articles:
        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
        
        

        However if I instead copy settings-security.xml to ~/.settings-security.xml and symlink it to ~/.m2/settings-security.xml then everything works as expected. ie. I need the file in both locations.

        Show
        Peter Lynch added a comment - There appears to be some regression here I have a ~/.m2/settings-security.xml and am running maven 3.0-beta-1 $mvn --version Using Java version: 1.6 Apache Maven 3.0-beta-1 (r935667; 2010-04-19 13:00:39-0400) Java version: 1.6.0_20 Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home Default locale: en_US, platform encoding: MacRoman OS name: "mac os x" version: "10.5.8" arch: "x86_64" Family: "mac" $mvn nexus:staging-list -U -up Using Java version: 1.6 [INFO] Scanning for projects... [INFO] snapshot org.sonatype.plugins:nexus-maven-plugin:1.3.2.2-SNAPSHOT: checking for updates from central [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building staging-test 1.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- nexus-maven-plugin:1.3.2.2-SNAPSHOT:staging-list (default-cli) @ staging-test --- [INFO] snapshot org.sonatype.nexus.restlight:nexus-restlight-stage-client:1.7.1-SNAPSHOT: checking for updates from central [INFO] snapshot org.sonatype.nexus.restlight:nexus-restlight-clients:1.7.1-SNAPSHOT: checking for updates from central [INFO] snapshot org.sonatype.nexus:nexus-clients:1.7.1-SNAPSHOT: checking for updates from central [INFO] snapshot org.sonatype.nexus:nexus:1.7.1-SNAPSHOT: checking for updates from central [INFO] snapshot org.sonatype.nexus.restlight:nexus-restlight-client-common:1.7.1-SNAPSHOT: checking for updates from central [INFO] snapshot org.sonatype.nexus.restlight:nexus-restlight-m2-settings-client:1.7.1-SNAPSHOT: checking for updates from central [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.444s [INFO] Finished at: Tue Jun 29 15:41:29 EDT 2010 [INFO] Final Memory: 4M/265M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.sonatype.plugins:nexus-maven-plugin:1.3.2.2-SNAPSHOT:staging-list (default-cli) on project staging-test: Failed to discover Nexus instance. Failed to decrypt server password: {RA55TEClhiYHZqfMtX4PmGtXpDsVT0/tW2xgFNiL4u4=} deployment123 default: org.sonatype.plexus.components.sec.dispatcher.shaded.SecDispatcherException: java.io.FileNotFoundException: /Users/plynch/.settings-security.xml (No such file or directory) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException However if I instead copy settings-security.xml to ~/.settings-security.xml and symlink it to ~/.m2/settings-security.xml then everything works as expected. ie. I need the file in both locations.
        Peter Lynch made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Hide
        Benjamin Bentmann added a comment -

        [ERROR] Failed to execute goal org.sonatype.plugins:nexus-maven-plugin:1.3.2.2-SNAPSHOT:staging-list (default-cli) [...] org.sonatype.plexus.components.sec.dispatcher.shaded.SecDispatcherException: java.io.FileNotFoundException: /Users/plynch/.settings-security.xml (No such file or directory) -> [Help 1]

        This is a bug in the nexus-maven-plugin which uses a custom component with a wrong configuration.

        Show
        Benjamin Bentmann added a comment - [ERROR] Failed to execute goal org.sonatype.plugins:nexus-maven-plugin:1.3.2.2-SNAPSHOT:staging-list (default-cli) [...] org.sonatype.plexus.components.sec.dispatcher.shaded.SecDispatcherException: java.io.FileNotFoundException: /Users/plynch/.settings-security.xml (No such file or directory) -> [Help 1] This is a bug in the nexus-maven-plugin which uses a custom component with a wrong configuration.
        Benjamin Bentmann made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Peter Lynch added a comment -

        In case someone is needs to cross reference, this is fixed in version 1.3.3 of nexus-maven-plugin.

        Show
        Peter Lynch added a comment - In case someone is needs to cross reference, this is fixed in version 1.3.3 of nexus-maven-plugin.

          People

          • Assignee:
            Benjamin Bentmann
            Reporter:
            Anders Hammar
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: