【问题标题】:maven-scm-plugin and git. when downloading files from repository - NullPointerExceptionmaven-scm-plugin 和 git。从存储库下载文件时 - NullPointerException
【发布时间】:2022-02-11 07:44:06
【问题描述】:

我想使用 maven-scm-plugin 从 git 存储库(又名克隆)下载文件到项目目录

我遇到了一个错误

Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.12.2:export (myjsp) on project myproject-tomcat-web: Execution myjsp of goal org.apache.maven.plugins:maven-scm-plugin:1.12.2:export failed.: NullPointerException

在 pom.xml 中我使用以下构造

            <plugin>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.12.2</version>
                <executions>
                    <execution>
                        <id>myjsp</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>export</goal>
                        </goals>
                        <configuration>
                            <connectionUrl>scm:git:https://git.myserver.com/myurl.git</connectionUrl>
                            <exportDirectory>target/web-resources/WEB-INF/resource</exportDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

同时,一切都从 SVN 存储库正常加载(将 url 设置为 connectionUrl 时)。

可能是什么问题?

【问题讨论】:

  • 你能检查Java的版本吗?我的意思是看看你的 IDE 选择了哪个 java 版本。
  • @Zakir Hussain java = 1.8,最令人惊讶的是,从SVN存储库下载文件时没有问题

标签: java maven maven-plugin maven-scm-plugin


【解决方案1】:

已解决,应该设置checkoutDirectory而不是exportDirectory

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-10
    • 1970-01-01
    • 1970-01-01
    • 2017-05-19
    • 2015-07-18
    • 2018-04-08
    相关资源
    最近更新 更多