gpt4 book ai didi

java - 无法使用 Maven 解决 Artifact 错误

转载 作者:行者123 更新时间:2023-11-30 08:09:55 25 4
gpt4 key购买 nike

当我使用 Maven 构建模块时,出现以下错误:谁能告诉我这个错误到底意味着什么?

[ERROR] Failed to execute goal com.dsths.common:container-maven-plugin:1.2.1:dis
t (build-distributions) on project pmDist: Unable to create distribution: Could
not resolve artifact: com.dsths.awdprovidermatching:pmConfig:jar:default-externa
l-jetty:1.0.2-SNAPSHOT:COMPILE -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception

作为引用,这里是 pmConfig 模块的 pom 文件:

<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>pmConfig</artifactId>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<parent>
<groupId>com.dsths.awdprovidermatching</groupId>
<artifactId>AWDProviderMatching</artifactId>
<version>1.0.2-SNAPSHOT</version>
</parent>
<description>A POM-based project for filtering and collecting the various configurations for AWDProviderMatching.</description>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>

<execution>
<id>dev-localhost-make-assembly</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/generated-resources/dev-localhost</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/assembly</directory>
<includes>
<include>*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<filters>
<filter>${project.basedir}/src/main/filters/default.properties</filter>
<filter>${project.basedir}/src/main/filters/hostenv/localhost.properties</filter>
<filter>${project.basedir}/src/main/filters/appenv/dev.properties</filter>
</filters>
<overwrite>true</overwrite>
</configuration>
</execution>

<execution>
<id>turnkey-external-make-assembly</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/generated-resources/turnkey-external</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/assembly</directory>
<includes>
<include>*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<filters>
<filter>${project.basedir}/src/main/filters/default.properties</filter>
<filter>${project.basedir}/src/main/filters/hostenv/external.properties</filter>
<filter>${project.basedir}/src/main/filters/appenv/turnkey.properties</filter>
</filters>
<overwrite>true</overwrite>
</configuration>
</execution>


<execution>
<id>vcloud-vcloud-make-assembly</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/generated-resources/vcloud-vcloud</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/assembly</directory>
<includes>
<include>*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<filters>
<filter>${project.basedir}/src/main/filters/default.properties</filter>
<filter>${project.basedir}/src/main/filters/hostenv/vcloud.properties</filter>
<filter>${project.basedir}/src/main/filters/appenv/vcloud.properties</filter>
</filters>
<overwrite>true</overwrite>
</configuration>
</execution>

</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>dev-localhost-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${project.build.directory}/generated-resources/dev-localhost/template-zip-assembly.xml</descriptor>
</descriptors>
<filters>
<filter>${project.basedir}/src/main/filters/default.properties</filter>
<filter>${project.basedir}/src/main/filters/hostenv/localhost.properties</filter>
<filter>${project.basedir}/src/main/filters/appenv/dev.properties</filter>
</filters>
</configuration>
</execution>
<execution>
<id>dev-localhost-jboss-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${project.build.directory}/generated-resources/dev-localhost/template-jboss-jar-assembly.xml</descriptor>
</descriptors>
<filters>
<filter>${project.basedir}/src/main/filters/default.properties</filter>
<filter>${project.basedir}/src/main/filters/hostenv/localhost.properties</filter>
<filter>${project.basedir}/src/main/filters/appenv/dev.properties</filter>
</filters>
</configuration>
</execution>
<execution>
<id>dev-localhost-jetty-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${project.build.directory}/generated-resources/dev-localhost/template-jetty-jar-assembly.xml</descriptor>
</descriptors>
<filters>
<filter>${project.basedir}/src/main/filters/default.properties</filter>
<filter>${project.basedir}/src/main/filters/hostenv/localhost.properties</filter>
<filter>${project.basedir}/src/main/filters/appenv/dev.properties</filter>
</filters>
</configuration>
</execution>
<execution>
<id>vcloud-jetty-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${project.build.directory}/generated-resources/vcloud-vcloud/template-jetty-jar-assembly.xml</descriptor>
</descriptors>
<filters>
<filter>${project.basedir}/src/main/filters/default.properties</filter>
<filter>${project.basedir}/src/main/filters/hostenv/vcloud.properties</filter>
<filter>${project.basedir}/src/main/filters/appenv/vcloud.properties</filter>
</filters>
</configuration>
</execution>
<execution>
<id>default-jetty-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${project.build.directory}/generated-resources/turnkey-external/template-jetty-jar-assembly.xml</descriptor>
</descriptors>
<filters>
<filter>${project.basedir}/src/main/filters/default.properties</filter>
<filter>${project.basedir}/src/main/filters/hostenv/external.properties</filter>
<filter>${project.basedir}/src/main/filters/appenv/turnkey.properties</filter>
</filters>
</configuration>
</execution>

<execution>
<id>mdwise-properties-conf-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${project.basedir}/src/main/assembly/template-zip-assembly-properties-mdwise.xml</descriptor>
</descriptors>

</configuration>
</execution>

<execution>
<id>dbscripts-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${project.basedir}/src/main/assembly/template-zip-assembly-dbscripts.xml</descriptor>
</descriptors>

</configuration>
</execution>

</executions>
</plugin>
</plugins>
</build>
</project>

以下是失败模块的pom文件:

<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.dsths.awdprovidermatching</groupId>
<artifactId>AWDProviderMatching</artifactId>
<version>1.0.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>pmDist</artifactId>
<!-- using POM packaging since all artifacts are produced by the container-maven-plugin plugin -->
<packaging>pom</packaging>

<dependencies>
<!--
Dependencies listed here are not used in the build. They only exist to force maven to
build the dependent projects before this one. You only need to add your project's war
module and the configuration module. If your project produces multiple WAR files, they
should both be included.
-->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${war.artifactId}</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${config.artifactId}</artifactId>
<version>${project.version}</version>
<classifier>${config.classifier}</classifier>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.dsths.common</groupId>
<artifactId>container-maven-plugin</artifactId>
<version>${dstcontainer.version}</version>
<executions>
<execution>
<id>build-distributions</id>
<phase>package</phase>
<goals><goal>dist</goal></goals>
</execution>
</executions>
<configuration>
<artifacts>
<!-- configuration artifact -->
<artifact>
<groupId>${project.groupId}</groupId>
<artifactId>${config.artifactId}</artifactId>
<version>${project.version}</version>
<classifier>${config.classifier}</classifier>
<unpack>true</unpack>
<targetDir>conf</targetDir>
</artifact>
<!-- war artifact -->
<artifact>
<groupId>${project.groupId}</groupId>
<artifactId>${war.artifactId}</artifactId>
<version>${project.version}</version>
<type>war</type>
<targetDir>deploy/tenanted</targetDir>
</artifact>
</artifacts>
</configuration>
</plugin>
</plugins>
</build>

<properties>
<config.artifactId>pmConfig</config.artifactId>
<config.classifier>default-external-jetty</config.classifier>
<war.artifactId>pmWeb</war.artifactId>
</properties>

</project>

最佳答案

这是由于您的 Maven 版本所致。您需要降级到 Maven 3.0.5,它就能正常工作。

来源:我在同一个地方工作:)

关于java - 无法使用 Maven 解决 Artifact 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30527970/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com