【问题标题】:Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3未能执行目标 org.apache.maven.plugins:maven-release-plugin:2.5.3
【发布时间】:2020-08-28 13:41:57
【问题描述】:

我正在开发一个 spring-boot 应用程序,它有 2 个模块 pet-clinic-web 和 pet-clinic-data 现在我没有任何类或查看页面,除了我的宠物诊所上的一些数据模型类-数据,我使用 maven 作为我的依赖管理我需要在终端上做mvn release:prepare,但是在一个过程中我有一个错误

错误

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.

项目行家

<?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 /> <!-- lookup parent from repository -->
    </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>

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



    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <goals>install</goals>
                    <autoVersionSubmodules>true</autoVersionSubmodules>

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

宠物诊所数据

<?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>
<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>

宠物诊所网络

<?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>
<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>

我的项目结构

【问题讨论】:

    标签: java xml spring spring-boot maven


    【解决方案1】:

    不确定这是否会有所帮助,因为我没有看到整个错误,但是 我希望它会 1/摆脱

    <properties>
        <java.version>1.8</java.version>
    </properties>
    
    and add this to the root
           
    
       <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/ do a mvn clean 
    3/ do mvn release:prepare
    4/ do mvn release: perform
    

    【讨论】:

      【解决方案2】:

      您尝试发布的项目必须具有 SNAPSHOT 版本。它应该是这样的:

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

      【讨论】:

      • 我按照你说的做了,现在我有一个新错误Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project sfg-pet-clinic: Maven execution failed, exit code: '1'
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-01-02
      • 2013-05-30
      • 2016-02-27
      • 2015-11-08
      • 2020-09-02
      • 2012-09-04
      • 1970-01-01
      相关资源
      最近更新 更多