我的spring项目中没有生成jar文件

问题描述 投票:0回答:1

我的名字是亚历克斯。我正在学习spring,并且已经完成了一个项目。现在我想将它上传到互联网并发布在我的作品集中。但是,当我在 cmd 中发出以下命令时: mvn clean package 我收到图像错误。 enter image description here

我还要与您分享的是我的 pom.xml 和 application.properties。我已经尝试解决这个问题两天了,但找不到解决方案。我希望你可以帮助我。非常感谢。

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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.0</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.projetspring.meriem</groupId>
    <artifactId>projet-spring-react</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>ecommerce-backend</name>
    <description>projet spring react</description>
    <properties>
        <java.version>11</java.version>
    </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-data-rest</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>com.h2database</groupId>
            <artifactId>h2</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-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <!-- Configuración del plugin de compilación de Maven -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

应用程序.属性

# Configuración de tamaño de archivos
spring.servlet.multipart.max-file-size=500KB
spring.servlet.multipart.max-request-size=500KB

# Configuración de la base de datos para Azure
spring.datasource.url=jdbc:mysql://databasenavarra.mysql.database.azure.com:3306/ecommerce_navarra_spring?serverTimezone=UTC
spring.datasource.username=adminuserdb@databasenavarra
spring.datasource.password=Xxchalo24397xX
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

# Configuración de JPA e Hibernate
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
java spring-boot maven deployment maven-plugin
1个回答
0
投票

尝试手动删除打包文件,然后重新打包。

© www.soinside.com 2019 - 2024. All rights reserved.