当前位置: 首页 > 知识库问答 >
问题:

在使用Maven的项目上打包和安装时出错

单于高逸
2023-03-14

当我尝试在项目中使用Maven时,出现以下错误:

E:\path\to\project>mvn clean install
---------------------------------------------------
constituent[0]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../conf/logging/
constituent[1]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/animal-sniffer-annotations-1.14.jar
constituent[2]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/aopalliance-1.0.jar
constituent[3]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/cdi-api-1.0.jar
constituent[4]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/checker-compat-qual-2.0.0.jar
constituent[5]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/commons-cli-1.4.jar
constituent[6]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/commons-io-2.5.jar
constituent[7]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/commons-lang3-3.8.1.jar
constituent[8]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/error_prone_annotations-2.1.3.jar
constituent[9]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/guava-25.1-android.jar
constituent[10]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/guice-4.2.1-no_aop.jar
constituent[11]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/j2objc-annotations-1.1.jar
constituent[12]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/jansi-1.17.1.jar
constituent[13]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/javax.inject-1.jar
constituent[14]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/jcl-over-slf4j-1.7.25.jar
constituent[15]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/jsr250-api-1.0.jar
constituent[16]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/jsr305-3.0.2.jar
constituent[17]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-artifact-3.6.0.jar
constituent[18]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-builder-support-3.6.0.jar
constituent[19]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-compat-3.6.0.jar
constituent[20]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-core-3.6.0.jar
constituent[21]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-embedder-3.6.0.jar
constituent[22]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-model-3.6.0.jar
constituent[23]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-model-builder-3.6.0.jar
constituent[24]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-plugin-api-3.6.0.jar
constituent[25]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-repository-metadata-3.6.0.jar
constituent[26]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-api-1.3.1.jar
constituent[27]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-connector-basic-1.3.1.jar
constituent[28]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-impl-1.3.1.jar
constituent[29]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-provider-3.6.0.jar
constituent[30]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-spi-1.3.1.jar
constituent[31]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-transport-wagon-1.3.1.jar
constituent[32]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-resolver-util-1.3.1.jar
constituent[33]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-settings-3.6.0.jar
constituent[34]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-settings-builder-3.6.0.jar
constituent[35]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-shared-utils-3.2.1.jar
constituent[36]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/maven-slf4j-provider-3.6.0.jar
constituent[37]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/org.eclipse.sisu.inject-0.3.3.jar
constituent[38]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/org.eclipse.sisu.plexus-0.3.3.jar
constituent[39]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/plexus-cipher-1.7.jar
constituent[40]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/plexus-component-annotations-1.7.1.jar
constituent[41]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/plexus-interpolation-1.25.jar
constituent[42]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/plexus-sec-dispatcher-1.4.jar
constituent[43]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/plexus-utils-3.1.0.jar
constituent[44]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/slf4j-api-1.7.25.jar
constituent[45]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/wagon-file-3.2.0.jar
constituent[46]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/wagon-http-3.2.0-shaded.jar
constituent[47]: file:/E:/Entwicklung/Programme/apache-maven-3.6.0/bin/../lib/wagon-provider-api-3.2.0.jar
---------------------------------------------------
Exception in thread "main" java.lang.StackOverflowError
        at java.io.InputStream.<init>(InputStream.java:45)
        at java.io.FileInputStream.<init>(FileInputStream.java:123)
        at org.sonatype.plexus.components.sec.dispatcher.SecUtil.toStream(SecUtil.java:100)
        at org.sonatype.plexus.components.sec.dispatcher.SecUtil.read(SecUtil.java:56)

我测试了Maven 3.6.0和3.3.9。它不依赖于项目;每个Maven项目都提供相同的异常。

该项目有一个具有两个模块的父POM,一个Angular项目和一个Spring Boot项目。

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 http://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.1.1.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>de.business.customer</groupId>
    <artifactId>product-root</artifactId>
    <version>1.0.0-beta.9</version>
    <packaging>pom</packaging>

    <name>Product Parent</name>
    <description>Parent project for Angular and Spring.</description>

    <modules>
        <module>angular-gui</module>
        <module>spring-gui-backend</module>
    </modules>

    <properties>
        <project.version>1.0.0-beta.9</project.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.finalName>product</project.build.finalName>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <java.version>1.8</java.version>
        <spring-cloud.version>Greenwich.M3</spring-cloud.version>
        <keycloak.version>4.6.0.Final</keycloak.version>
        <joda-time.version>2.10</joda-time.version>
        <hibernate.version>5.3.6.Final</hibernate.version>
        <postgres.version>42.2.5</postgres.version>
        <springfox.version>2.9.2</springfox.version>

        <docker.repository>https://link.to.hub.de</docker.repository>
        <docker.folder>docker-folder</docker.folder>
    </properties>

</project>

pom.xml-Spring靴

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

    <parent>
        <groupId>de.business.customer</groupId>
        <artifactId>product-root</artifactId>
        <version>1.0.0-beta.9</version>
    </parent>

    <artifactId>spring-gui-backend</artifactId>
    <version>1.0.0-beta.9</version>
    <packaging>jar</packaging>

    <name>spring-gui</name>
    <description>Rest API for GUI.</description>

    <repositories>
        <repository>
            <id>repository.springframework.maven.milestone</id>
            <name>Spring Framework Maven Milestone Repository</name>
            <url>http://repo.spring.io/milestone</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>spring-milestones</id>
            <url>https://repo.spring.io/milestone</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.keycloak.bom</groupId>
                <artifactId>keycloak-adapter-bom</artifactId>
                <version>${keycloak.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
        </dependency>
        <!--<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>-->
        <!--<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
        </dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>

        <!--  Postgres -->
        <!--<dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${postgres.version}</version>
        </dependency>-->

        <!--  Keycloak -->
        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-spring-security-adapter</artifactId>
        </dependency>

        <!--  Lombok -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>

        <!--  Joda Time -->
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${joda-time.version}</version>
        </dependency>

        <!--  Hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>${hibernate.version}</version>
        </dependency>

        <!-- Jackson -->
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-joda</artifactId>
            <version>2.9.7</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.9.7</version>
        </dependency>

        <!-- Springfox Swagger -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${springfox.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${springfox.version}</version>
        </dependency>

        <!-- Google Guava -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>27.0-jre</version>
        </dependency>

        <!-- OpenCSV -->
        <dependency>
            <groupId>com.opencsv</groupId>
            <artifactId>opencsv</artifactId>
            <version>4.1</version>
        </dependency>

    </dependencies>

    <build>
        <finalName>${project.build.finalName}</finalName>

        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>dockerfile-maven-plugin</artifactId>
                <version>1.4.9</version>
                <executions>
                    <execution>
                        <id>default</id>
                        <goals>
                            <!--<goal>tag</goal>-->
                            <goal>build</goal>
                            <goal>push</goal>
                        </goals>
                        <configuration>
                            <tag>${project.version}</tag>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-2</id>
                        <goals>
                            <goal>tag</goal>
                            <!--<goal>build</goal>-->
                            <goal>push</goal>
                        </goals>
                        <configuration>
                            <tag>latest</tag>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <repository>${docker.folder}/backend</repository>
                    <buildArgs>
                        <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                    </buildArgs>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>de.business.customer</groupId>
    <artifactId>product-root</artifactId>
    <version>1.0.0-beta.9</version>
  </parent>

  <artifactId>angular-gui</artifactId>
  <packaging>pom</packaging>

  <name>angular-gui</name>
  <description>Angular Application UI.</description>

  <build>
    <plugins>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>1.6</version>
        <executions>
          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
          </execution>
          <execution>
            <id>npm install</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>install</arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm build</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>run build</arguments>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <nodeVersion>v11.4.0</nodeVersion>
          <npmVersion>6.5.0</npmVersion>
          <installDirectory>target</installDirectory>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.spotify</groupId>
        <artifactId>dockerfile-maven-plugin</artifactId>
        <version>1.4.9</version>
        <executions>
          <execution>
            <id>default</id>
            <goals>
              <!--<goal>tag</goal>-->
              <goal>build</goal>
              <goal>push</goal>
            </goals>
            <configuration>
              <tag>${project.version}</tag>
            </configuration>
          </execution>
          <execution>
            <id>default-2</id>
            <goals>
              <goal>tag</goal>
              <!--<goal>build</goal>-->
              <goal>push</goal>
            </goals>
            <configuration>
              <tag>latest</tag>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <repository>${docker.folder}/frontend</repository>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

有人有主意吗?

共有1个答案

陆涵畅
2023-03-14

好的,设置安全性中存在路径错误。xml。

 类似资料:
  • 无法将org.apache.maven:maven-archiver:pom:2.6从https://repo.maven.apache.org/maven2中缓存到本地存储库中,在central的更新间隔已过或强制更新之前,将不会重新尝试解决问题。原始错误:无法将工件org.apache.maven:maven-archiver:pom:2.6从/传送到central(https://repo.

  • 我在网上搜索并找到了以下资源,我尝试了这些资源(请参见pom),但无法工作: 1)Spark用户邮件列表:http://apache-spark-user-list.1001560.n3.nabble.com/packaging-a-spark-job-using-maven-td5615.html 2)如何打包spark scala应用程序 我有一个简单的例子来演示这个问题,一个简单的1类项目(

  • 我正试图在Windows8上安装R中的Rmpi包。R版本是3.4.3。 我收到这个消息 当我想运行这个库时,我得到了这样一条消息:过程入口点MPI_COMM_SPLIT_TYPE在动态链接库中找不到:user/.../r/win-library/3.4/rmpi/libs/x64/rmpi.dll 当我单击ok时,我在Cosole中得到了这个错误: 我的计算机中有ms-mpi,我删除了它并安装了M

  • 我正在使用Eclipse Helios。我需要在eclipse上安装Maven插件。 我使用以下更新网址:http://download.eclipse.org/technology/m2e/releases 无法完成安装,因为找不到一个或多个必需项。正在安装的软件:用于Eclipse1.4的m2e-Maven集成。0.20130601-0317(org.eclipse.m2e.feature.f

  • 我在完成maven 3.3.1的安装时遇到了问题(我找不到3.2.2版本进行下载)。 maven文件夹位于此程序文件中

  • 我试图在Windows7中为Python3.4安装一个图表工具(Matplotlib-V1.4.2),但到目前为止,我的所有尝试似乎都无法完成这一工作。 尝试: 我已从GitHub下载了pip -不使用 这里有一个类似的问题,我也尝试了这些建议,但我得到了以下错误 我肯定我错过了什么,你的一步一步的指导在这方面将非常感谢。