Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用maven release命令发布基于java的git项目_Java_Git_Maven - Fatal编程技术网

使用maven release命令发布基于java的git项目

使用maven release命令发布基于java的git项目,java,git,maven,Java,Git,Maven,我在Bitbucket上有一个Git项目,我正试图使用mvn release:prepare命令发布它,但我遇到了以下异常 我知道它在询问我的密码,但不确定在哪里以及如何指定密码 错误日志: [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ----------------------------------------------

我在Bitbucket上有一个Git项目,我正试图使用
mvn release:prepare
命令发布它,但我遇到了以下异常

我知道它在询问我的密码,但不确定在哪里以及如何指定密码

错误日志:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.355 s
[INFO] Finished at: 2015-10-20T12:17:04-04:00
[INFO] Final Memory: 13M/166M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project git-cicd-demo: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] bash: /dev/tty: No such device or address
[ERROR] error: failed to execute prompt script (exit code 1)
[ERROR] fatal: could not read Password for 'https://nitalchandel@bitbucket.org': Invalid argument
[ERROR] -> [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/MojoFailureException
pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.study.git.cicd</groupId>
    <artifactId>git-cicd-demo</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <!-- VCS integration -->
    <scm>
        <connection>scm:git:https://nitalchandel@bitbucket.org/nitalchandel/git-cicd-demo.git</connection>
        <url>https://nitalchandel@bitbucket.org/nitalchandel/git-cicd-demo</url>
        <developerConnection>scm:git:https://nitalchandel@bitbucket.org/nitalchandel/git-cicd-demo.git</developerConnection>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.5.201505241946</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

4.0.0
com.study.git.cicd
git cicd演示
1.0-快照
罐子
scm:git:https://nitalchandel@bitbucket.org/nitalchandel/git-cicd-demo.git
https://nitalchandel@bitbucket.org/nitalchandel/git-cicd-demo
scm:git:https://nitalchandel@bitbucket.org/nitalchandel/git-cicd-demo.git
UTF-8
1.7
1.7
朱尼特
朱尼特
4.10
测试
org.jacoco
jacocomaven插件
0.7.5.201505241946
配制剂
报告
准备包装
报告

您应该能够在命令行中指定密码:

mvn release:prepare -Dpassword=qwerty ...

有关
发行版的全套选项,请参见:准备

首先使用更新版本的2.5.2…您可以在Maven设置中定义git密码。看见顺便说一句,如果您不想在文件中使用纯文本格式,也可以加密此密码。@Gael-我已在settings.xml文件中添加了密码,但不确定如何引用它。如何使用mvn release:prepare命令获取它?