gpt4 book ai didi

netbeans - Maven codehaus.mojo无法解析

转载 作者:行者123 更新时间:2023-12-03 16:24:54 29 4
gpt4 key购买 nike

我正在尝试使用NetBeans构建JavaFX项目,但是当我运行它时,我有一个this:

Plugin org.codehaus.mojo:exec-maven-plugin:1.2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:exec-maven-plugin:jar:1.2.1: Could not transfer artifact org.codehaus.mojo:exec-maven-plugin:pom:1.2.1 from/to HTTP (http://repo.maven.apache.org/maven2): Access denied to: http://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.2.1/exec-maven-plugin-1.2.1.pom , ReasonPhrase:Forbidden. -> [Help 1]

我在代理后面工作,但是我用代理配置了Netbeans,然后尝试了“测试连接”,这是可行的。

我还使用此代理配置了“.m2/settings.xml”目录
<?xml  version="1.0" encoding="UTF-8"?> <settings>   <proxies>
<proxy>
<active />
<protocol>http</protocol>
<username>username</username>
<password>password</password>
<port>8080</port>
<host>proxyhost</host>
<id/>
</proxy> </proxies>
<mirrors>
<mirror>
<id>HTTP</id>
<name>HTTP Central</name>
<url>http://repo.maven.apache.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror> </mirrors> </settings>

我的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>

<groupId>com.bega</groupId>
<artifactId>Chronos</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Chronos</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>com.bega.chronos.MainApp</mainClass>
</properties>

<organization>
<!-- Used as the 'Vendor' for JNLP generation -->
<name>Your Organisation</name>
</organization>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludeScope>system</excludeScope>
<excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>unpack-dependencies</id>

<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${java.home}/../bin/javafxpackager</executable>
<arguments>
<argument>-createjar</argument>
<argument>-nocss2bin</argument>
<argument>-appclass</argument>
<argument>${mainClass}</argument>
<argument>-srcdir</argument>
<argument>${project.build.directory}/classes</argument>
<argument>-outdir</argument>
<argument>${project.build.directory}</argument>
<argument>-outfile</argument>
<argument>${project.build.finalName}.jar</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>default-cli</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${java.home}/bin/java</executable>
<commandlineArgs>${runfx.args}</commandlineArgs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArguments>
<bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<additionalClasspathElements>
<additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>de.jensd</groupId>
<artifactId>fontawesomefx</artifactId>
<version>8.9</version>
</dependency>
</dependencies>

</project>

如果有人知道为什么那行不通?

最佳答案

我假设存储库服务器是临时的,无法正常工作。至少我能够下载错误消息中提到的文件。

不幸的是,Maven缓存了未找到的错误。因此,有很多关于重置缓存状态并强制重新下载的问题。

恕我直言,最简单的方法是从本地Maven存储库中删除有问题的工件的所有数据,该Maven存储库位于用户主目录的子目录.m2/repository中。

打开.m2/repository并进入路径org/codehaus/mojo/exec-maven-plugin/。在那里删除子目录1.2.1和所有包含的文件。 Maven将在下次需要它们时自动下载它们。

关于netbeans - Maven codehaus.mojo无法解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49858465/

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