简体   繁体   中英

I cant perform mvn release:prepare

I am trying to perform mvn release:prepare with tfs and got error:

 Command line - cmd.exe /X /C "tf status -login:[domain]\[username],null -workspace:workspace -recursive -format:detailed [pathToTheProject]"
[INFO] err - TF30063: You are not authorized to access [serverName].

I suspect that maven have problem with recognizing password or maybe I set my developerConnection wrong My Scm:

<scm>
    <developerConnection>scm:tfs:[domain]\\[username];[password]http[s]://server_name:workspace:$/TeamProject/Path/To/Project</developerConnection>
    <url>[domain]\\[username];[password]http[s]://server_name:workspace:$/TeamProject/Path/To/Project</url>
  </scm>

My build tag in maven:

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-scm-plugin</artifactId>
        <version>1.5</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-tfs</artifactId>
            <version>1.9.5</version>
            <scope>compile</scope>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-tfs</artifactId>
            <version>1.9.5</version>
            <scope>compile</scope>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

I cannot comment on your TFS config. But if you get an authentication failure for the SCM server, then you are probably lacking an entry like this for the server:

<server>
    <id>myServer</id>
    <username>theUserId</username>
    <password>{encryptedPassword}</password>
</server>

This should be set in the settings.xml file used by your build server running your maven builds. Check out the documentation on how to encrypt your passwords.

请尝试以下SCM URL

scm:tfs:[[domain\\]username[;password]@]http[s]://server_name[:port][:isCheckinPoliciesEnabled]:workspace:$/TeamProject/Path/To/Project

You would get an Access Denied error if maven were not able to authenticate. Instead you get a TF30063 which is mostly related to a permission issue: have you checked that the user authenticating with TFS has read permission to the TFS version control?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM