我的目录结构看起来像这样:
我的pom看起来像这样:
<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">
<scm>
<developerConnection>scm:git:file://../../.git</developerConnection>
</scm>
<modelVersion>4.0.0</modelVersion>
<groupId>grp</groupId>
<artifactId>artif</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<modules>
<module>../submodule</module>
</modules>
</properties>
<build>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<localCheckout>true</localCheckout>
<preparationGoals>
org.eclipse.tycho:tycho-versions-plugin:${tycho-version}:update-eclipse-metadata
org.apache.maven.plugins:maven-scm-plugin:1.9.5:add
<!-- org.apache.maven.plugins:maven-scm-plugin:1.9.5:checkin -->
</preparationGoals>
<completionGoals>
org.eclipse.tycho:tycho-versions-plugin:${tycho-version}:update-eclipse-metadata
org.apache.maven.plugins:maven-scm-plugin:1.9.5:add
<!-- org.apache.maven.plugins:maven-scm-plugin:1.9.5:checkin -->
</completionGoals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.5</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>add</goal>
<goal>checkin</goal>
</goals>
<configuration>
<includes>**/META-INF/MANIFEST.MF,**/feature.xml,**/*.product</includes>
<excludes>**/target/**</excludes>
<message>Changing the version to reflect the pom versions for the release</message>
<basedir>${project.basedir}/../..</basedir>
<workingDirectory>${project.basedir}/../..</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</project>
当我运行mvn release:prepare
时,我收到错误消息
[ERROR]致命:pathspec'src \ parent \ src \ submodule \ addme.product'做了 不匹配任何文件
因此,插件会找到它应该添加的文件,但是在创建命令行时不会尊重正确的根目录。如何修复此问题,而不更改父pom的位置?
答案 0 :(得分:0)
我遇到了类似的问题(我的根POM有一个父配置POM,它位于一个子文件夹中)。我只能通过创建一个“适当的”POM和文件夹层次结构来解决这个问题,这意味着: