我无法解决专家建筑错误故障

2022-09-03 09:12:37

当我使用maven构建我的 project.so 时,我收到一个错误,请帮忙!感谢您的帮助

未能在 project newstart-app-ithelp 上执行 goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly (make-assembly) on project newstart-app-ithelp: Execution make-assembly of goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly failed: for artifact {null:null:null:jar}: groupId 不能为空。原因: 执行 make-assembly of goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly failed: for artifact {null:null:null:jar}: groupId 不能为空。Stack trace : org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly (make-assembly) on project newstart-app-ithelp: Execution make-assembly of goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:assembly failed: for artifact {null:null:null:jar}: groupId 不能为空。

<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>
    <groupId>com.feinno.app</groupId>
    <artifactId>root-pom</artifactId>
    <version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>newstart.app</groupId>
<artifactId>newstart-app-ithelp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>newstart-app-ithelp</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.2.1</version>
            <configuration>
                <appendAssemblyId>false</appendAssemblyId>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <archive>
                    <manifest>
                        <mainClass>com.newstart.app.ithelp.ITHelpBean</mainClass>
                    </manifest>
                </archive>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>assembly</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <verbose>true</verbose>
                <fork>true</fork>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4.3</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.1.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.1.2</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.0</version>
    </dependency>
    <dependency>
        <groupId>com.feinno.app</groupId>
        <artifactId>feinno-app-common</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>2.2.0</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.24</version>
    </dependency>
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid</artifactId>
        <version>0.2.9</version>
    </dependency>
    <dependency>
        <groupId>spring-aop</groupId>
        <artifactId>spring-aop</artifactId>
        <version>3.2.3</version>
    </dependency>
    <dependency>
        <groupId>spring-beans</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.2.3</version>
    </dependency>
    <dependency>
        <groupId>spring-context</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.2.3</version>
    </dependency>
    <dependency>
        <groupId>spring-core</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.2.3</version>
    </dependency>
    <dependency>
        <groupId>spring-jdbc</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>3.2.3</version>
    </dependency>
    <dependency>
        <groupId>spring-tx</groupId>
        <artifactId>spring-tx</artifactId>
        <version>3.2.3</version>
    </dependency>
    <dependency>
        <groupId>spring-expression</groupId>
        <artifactId>spring-expression</artifactId>
        <version>3.2.3</version>
    </dependency>
    <dependency>
        <groupId>IKAnalyzer</groupId>
        <artifactId>IKAnalyzer</artifactId>
        <version>6</version>
    </dependency>
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-core</artifactId>
        <version>3.6.0</version>
    </dependency>
    <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache-core</artifactId>
        <version>2.6.0</version>
    </dependency>
    <dependency>
        <groupId>linq4j</groupId>
        <artifactId>linq4j</artifactId>
        <version>1.0</version>
    </dependency>
</dependencies>
<distributionManagement>
    <snapshotRepository>
        <id>snapshots</id>
        <url>http://10.10.208.92:8081/content/repositories/snapshots</url>
    </snapshotRepository>
</distributionManagement>


答案 1

我已通过删除本地文件夹来解决此问题。现在,生成已成功。.m2/repository


答案 2

而我有不同的解决方案。我有一个POM,它有一个没有的罐子的条目它有一个带有.另外,父POM有一个具有相同.显然,这让Maven感到困惑(3.3)。构建工作正常,但包装却没有。<dependencyManagement><version><dependencies><version><dependencyManagement><version>

修复:删除子 POM 中的条目,并从子 POM 中的条目中删除 。<dependencyManagement><version><dependencies>

在代码中,这是损坏的情况:

Parent pom.xml:
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${httpclient.version}</version>
        </dependency>
    </dependencies>
</dependencyManagement>

Child pom.xml:
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
    </dependencies>
</dependencyManagement>
...
<dependencies>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>${httpclient.version}</version>
    </dependency>
</dependencies>

后修复:父POM是一样的,子POM正好有这个

<dependencies>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
    </dependency>
</dependencies>

推荐