Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3

huangapple go评论134阅读模式
英文:

Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3

问题

我正在开发一个 Spring Boot 应用程序,其中有两个模块:pet-clinic-web 和 pet-clinic-data。目前除了在 pet-clinic-data 中的一些数据模型类之外,我还没有任何类或视图页面。我使用 Maven 作为我的依赖管理工具,我需要在终端上运行 "mvn release:prepare",但在过程中出现了错误。

**错误信息**

在项目 sfg-pet-clinic 上执行目标 org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) 失败:在反应堆项目列表中没有 SNAPSHOT 项目。


**项目 Maven 配置**
```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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <packaging>pom</packaging>
    <modules>
        <module>pet-clinic-data</module>
        <module>pet-clinic-web</module>
    </modules>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.3.RELEASE</version>
        <relativePath /> <!-- 从仓库中查找父项目 -->
    </parent>

    <groupId>gure.springframework</groupId>
    <artifactId>sfg-pet-clinic</artifactId>
    <version>0.0.5</version>
    <name>sfg-pet-clinic</name>
    <description>Demo project for Spring Boot</description>

    <!-- 其他配置项 -->
</project>

pet-clinic-data 模块配置

<?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">
    <parent>
        <artifactId>sfg-pet-clinic</artifactId>
        <groupId>gure.springframework</groupId>
        <version>0.0.5</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>pet-clinic-data</artifactId>
    <properties>
        <spring-boot.repackage.skip>true</spring-boot.repackage.skip>
    </properties>

    <!-- 依赖配置 -->
</project>

pet-clinic-web 模块配置

<?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>org.example</groupId>
    <artifactId>pet-clinic-web</artifactId>
    <version>0.0.5</version>
    <parent>
        <artifactId>sfg-pet-clinic</artifactId>
        <groupId>gure.springframework</groupId>
        <version>0.0.5</version>
    </parent>

    <!-- 依赖配置 -->
</project>

项目结构
(参考图像,此处省略)



<details>
<summary>英文:</summary>

i am developing a spring-boot application which has a 2 module pet-clinic-web and pet-clinic-data right now i don&#39;t have any classes or view page except some data model class on my pet-clinic-data and i am using maven as my dependency management i need to do ``mvn release:prepare`` on the terminal but i have a error during a process

**error**

Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project sfg-pet-clinic: You don't have a SNAPSHOT project in the reactor projects list.

**project maven**

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>pet-clinic-data</module>
<module>pet-clinic-web</module>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

&lt;groupId&gt;gure.springframework&lt;/groupId&gt;
&lt;artifactId&gt;sfg-pet-clinic&lt;/artifactId&gt;
&lt;version&gt;0.0.5&lt;/version&gt;
&lt;name&gt;sfg-pet-clinic&lt;/name&gt;
&lt;description&gt;Demo project for Spring Boot&lt;/description&gt;

&lt;properties&gt;
    &lt;java.version&gt;1.8&lt;/java.version&gt;
&lt;/properties&gt;



&lt;build&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
            &lt;configuration&gt;
                &lt;goals&gt;install&lt;/goals&gt;
                &lt;autoVersionSubmodules&gt;true&lt;/autoVersionSubmodules&gt;

            &lt;/configuration&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
&lt;/build&gt;

<scm>
<developerConnection>scm:git:https://github.com/springframeworkguru/sfg-pet-clinic.git</developerConnection>
<tag>sfg-pet-clinic-0.0.5</tag>
</scm>
</project>

**pet-clinic data**

<?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&quot;>
<parent>
<artifactId>sfg-pet-clinic</artifactId>
<groupId>gure.springframework</groupId>
<version>0.0.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

&lt;artifactId&gt;pet-clinic-data&lt;/artifactId&gt;
&lt;properties&gt;
    &lt;spring-boot.repackage.skip&gt;true&lt;/spring-boot.repackage.skip&gt;
&lt;/properties&gt;

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!-- <dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<!-- <execution>
<goals>
<goal>
repackage
</goal>
</goals>
<configuration>
<skip>
true
</skip>
</configuration>
</execution>-->
</executions>
</plugin>
</plugins>
</build>
</project>

**pet-clinic-web**

<?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&quot;>
<modelVersion>4.0.0</modelVersion>

&lt;groupId&gt;org.example&lt;/groupId&gt;
&lt;artifactId&gt;pet-clinic-web&lt;/artifactId&gt;
&lt;version&gt;0.0.5&lt;/version&gt;
&lt;parent&gt;
    &lt;artifactId&gt;sfg-pet-clinic&lt;/artifactId&gt;
    &lt;groupId&gt;gure.springframework&lt;/groupId&gt;
    &lt;version&gt;0.0.5&lt;/version&gt;
&lt;/parent&gt;

<dependencies>
<dependency>
<artifactId>pet-clinic-data</artifactId>
<groupId>gure.springframework</groupId>
<version>0.0.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>

**structure of my project**

[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/AG6Vh.png

</details>


# 答案1
**得分**: 0

你试图发布的项目必须有一个SNAPSHOT版本。它应该是这个样子:

    <version>X.X.X-SNAPSHOT</version>

<details>
<summary>英文:</summary>

The project that you are trying to release must have a SNAPSHOT version. It should look like this:

    &lt;version&gt;X.X.X-SNAPSHOT&lt;/version&gt;

</details>



# 答案2
**得分**: 0

以下是翻译好的内容:

不确定这是否会有帮助,因为我没有看到完整的错误信息,但我希望能够帮上忙。
1/ 去掉以下部分:

```xml
<properties>
    <java.version>1.8</java.version>
</properties>

然后在根部添加以下内容:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <configuration>
        <goals>install</goals>
    </configuration>
</plugin>
<scm>
    <developerConnection>scm:git:${git_url}</developerConnection>
    <tag>HEAD</tag>
</scm>

2/ 运行命令:mvn clean
3/ 运行命令:mvn release:prepare
4/ 运行命令:mvn release:perform

英文:

there not sure if this will help because I didn't see the whole error but
I hope it does
1/get rid of

&lt;properties&gt;
    &lt;java.version&gt;1.8&lt;/java.version&gt;
&lt;/properties&gt;

and add this to the root
       

   &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
            &lt;configuration&gt;
                &lt;goals&gt;install&lt;/goals&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
 &lt;scm&gt;
    &lt;developerConnection&gt;scm:git:${git_url}&lt;/developerConnection&gt;
  &lt;tag&gt;HEAD&lt;/tag&gt;
&lt;/scm&gt;

2/ do a mvn clean 
3/ do mvn release:prepare
4/ do mvn release: perform

huangapple
  • 本文由 发表于 2020年8月28日 21:41:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/63634979.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定