AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / coding / 问题

问题[maven](coding)

Martin Hope
pvrforpranavvr
Asked: 2025-04-24 12:05:53 +0800 CST

java.lang.NoSuchMethodError: 'org.apache.commons.compress.archivers.zip.ZipArchiveEntry org.apache.commons.compress.archivers.zip.ZipArchivelnputStrea

  • 5

将 Multipart xlsx文件转换为工作簿时出现异常。

ERROR - Entered Global Exception Handler. Exception occurred while processing the request: jakarta.servlet.ServletException:
Handler dispatch failed: java.lang.NoSuchMethodError: 'org.apache.commons.compress.archivers.zip.ZipArchiveEntry
org.apache.commons.compress.archivers.zip.ZipArchivelnputStream.getNextEntry0*
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1104)
maven
  • 1 个回答
  • 35 Views
Martin Hope
PatPanda
Asked: 2025-04-15 06:04:36 +0800 CST

Maven 站点“Maven 坐标”页面也指示了要从中下载的私有存储库

  • 4
  • 我想要实现的目标:

在 maven 生成的站点页面中,特别是“Maven 坐标”页面,我想添加私有存储库的信息以下载工件。

  • 显示一些代码:

这是我的 pom 文件的片段:

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.21.0</version>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
                <version>3.2.1</version>
                <configuration>
                    <tagListOptions>
                        <tagClasses>
                            <tagClass>
                                <tags>
                                    <tag>
                                        <matchString>todo</matchString>
                                        <matchType>ignoreCase</matchType>
                                    </tag>
                                </tags>
                            </tagClass>
                        </tagClasses>
                    </tagListOptions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.9.0</version>
            </plugin>
        </plugins>
    </reporting>

    <distributionManagement>
        <repository>
            <id>private-repository-release</id>
            <url>https://private.repository.com/artifactory/private-repository-release</url>
        </repository>
    </distributionManagement>

如您所见,此 jar 将被部署到私有存储库(在我的示例中为https://private.repository.com/artifactory/private-repository-release)

为了回答这个问题,我们假设这个私有存储库不需要身份验证。

  • 描述实际结果:

当mvn site在上面运行时,我确实得到了生成的 maven 网站(正在运行),但它看起来像这样(见图)

在此处输入图片描述

  • 问题

此页面缺少关于要下载的私有仓库的信息。我希望能够在网站上的 pom 文件中指明所需的仓库。

  • 描述预期结果:

我希望得到这样的结果:

在此处输入图片描述

为了告诉这个 jar 的用户,需要将存储库代码块添加到站点页面。

  <repositories>
        <repository>
            <id>private-repository-release</id>
            <url>https://private.repository.com/artifactory/private-repository-release</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.example</groupId>
            <artifactId>deleteme-kafka</artifactId>
            <version>2.2</version>
        </dependency>
  • 描述一下我尝试过的方法:

我尝试在 pom 中添加块,但没有成功,网站没有在“Maven 坐标”中指示所需的私有存储库。

虽然“分发管理”页面确实显示了一些有关私有存储库的信息,但它并没有告诉这个 jar 的用户如何配置 pom 来下载这个“私有 jar”。

  • 问题:

如何在“Maven 坐标”页面中添加存储库部分?

maven
  • 1 个回答
  • 22 Views
Martin Hope
PatPanda
Asked: 2024-12-06 06:08:03 +0800 CST

IntelliJ - 将 mvn clean install 变成一个按钮

  • 5

我正在使用 IntelliJ 开发 java maven 项目。

为了编译项目及其依赖项,我使用了很多mvn clean install

每次,我都会单击此图标上的 UI,然后单击重新加载(请参阅屏幕截图)

我尝试将此操作绑定到键盘或鼠标上的按钮。

但是,我找不到它是哪一个动作。

我能找到最接近的方法是绑定“运行配置”,但是,这并没有考虑到所有内容(屏幕截图中的所有步骤)

在此处输入图片描述

问题:

如何绑定mvn clean install到按钮?

maven
  • 1 个回答
  • 20 Views
Martin Hope
TStevens
Asked: 2024-12-05 21:50:03 +0800 CST

覆盖具有易受攻击的依赖项的 Maven 插件 - Nexus Quarantine

  • 5
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: C:\Tools\apache-maven-3.9.9-bin
Java version: 1.8.0_431, vendor: Oracle Corporation, runtime: C:\Tools\Java\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
java version "1.8.0_431"
Java(TM) SE Runtime Environment (build 1.8.0_431-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.431-b10, mixed mode)
C:\Users\user\projectX>mvn validate
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< projectX:projectX >--------------------------
[INFO] Building ProjectX 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
Downloading ...
[INFO]
[INFO] --- enforcer:3.4.1:enforce (enforce-versions) @ projectX ---
Downloading ...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  13.259 s
[INFO] Finished at: 2024-12-04T10:37:41-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.4.1:enforce (enforce-versions) on project projectX: Execution enforce-versions of goal org.apache.maven.plugins:maven-enforcer-plugin:3.4.1:enforce failed: Plugin org.apache.maven.plugins:maven-enforcer-plugin:3.4.1 or one of its dependencies could not be resolved:
[ERROR]         Could not transfer artifact commons-io:commons-io:jar:2.13.0 from/to nexus (https://nexus.xyz.com/repository/maven): status code: 403, reason phrase: -------------------->>> REQUESTED ITEM IS QUARANTINED -------------------->>> FOR DETAILS SEE ------>>> https://nexus-iq-server.xyz.com:8070/ui/links/repositories/quarantinedComponent/MzBlNmE1NmVjY2MyNDc5ZWI1MGZiNzAyMTkyZjVkODI <<<------ (403)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

commons-io : commons-io : 2.13.0
9   Security-High   High risk CVSS score    
Found security vulnerability CVE-2024-47554 with severity >= 7 (severity = 8.7)
Found security vulnerability CVE-2024-47554 with severity < 9 (severity = 8.7)

Nexus 表示要升级到 2.16.0。comomns.io 的最新版本是 2.18.0。

pom.xml

    <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://nexus.xyz.com/repository/raw/schemas/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>projectX</groupId>
        <artifactId>projectX</artifactId>
        <version>1.0-SNAPSHOT</version>
        <packaging>pom</packaging>

        <name>ProjectX</name>
        <description>An example of Nexus blocking vulnerable dependencies in Maven Plugins</description>
        <url></url>

        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                    <version>2.16.0</version>
                    <optional>false</optional>
                </dependency>
            </dependencies>
        </dependencyManagement>

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.4.1</version>
                    <executions>
                        <execution>
                            <id>enforce-versions</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <fail>true</fail>
                                <rules>
                                    <requireMavenVersion>
                                        <version>3.2.5</version>
                                    </requireMavenVersion>
                                    <requireJavaVersion>
                                        <version>[1.8,)</version>
                                    </requireJavaVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>

我通过 Nexus 访问 Maven 存储库。我尝试使用的许多插件都有一个或多个易受攻击的依赖项。Nexus 阻止了易受攻击的依赖项,构建失败。我创建了上述示例以尽可能简单地演示该问题。我将依赖项放在我的 pom 文件中,试图覆盖插件依赖项,但它不起作用。我的假设是,如果您在 pom 中的 dependencyManagement 中定义了依赖项,它将覆盖所有子依赖项版本,但这似乎是不正确的。有人知道纠正此问题的方法吗?任何帮助都将不胜感激。

maven
  • 1 个回答
  • 23 Views
Martin Hope
Anurag
Asked: 2024-11-28 18:29:20 +0800 CST

排除传递依赖项会破坏我的代码吗?

  • 6

我需要工件 A。因此,我将它包含在我的 pom.xml 中

<dependency>
      <groupId>some.group</groupId>
      <artifactId>some.artifact</artifactId>
      <version>some.version</version>
</dependency

工件 A 使用了工件 B,而我绝对不想将其复制到我的类路径中。因此,我对 B 使用了排除

<dependency>
     <groupId>some.group</groupId>
     <artifactId>some.artifact</artifactId>
     <version>some.version</version>
      <exclusions>
         <exclusion>
             <groupId>dontwant.group</groupId>
             <artifactId>dontwant.artifact</artifactId>
         </exclusion>
     <exclusions>
</dependency

我不依赖 B。但是,我依赖 A,并且 A 依赖于 B。B 现在未被复制到类路径。这会破坏我的代码吗?

maven
  • 2 个回答
  • 21 Views
Martin Hope
Rusty
Asked: 2024-09-29 09:44:15 +0800 CST

如何将 Java Swing 包导入 JavaFXML Maven 项目?

  • 7

我正在首次尝试使用 Netbeans、Maven 和 JavaFXML 开发一个小型桌面应用程序。我选择使用之前使用 Ant 开发的应用程序版本,并在 Maven 中运行它。但是在我的一个 Java 类中,Maven 版本标记了javax.swing.filechooser.FileSystemViewas的导入

package javax.swing.filechooser is not visible. Package javax.swing.filechooser is declared in module java.desktop but module myapp does not read it. 

这个问题在之前的版本中没有出现过。我搜索了这个论坛、Oracle 论坛和许多网络搜索来寻找解决方案,但没有成功。如果能得到一些帮助来解决这个问题,我将不胜感激。

我搜索了这个论坛、Oracle 论坛和许多网络搜索,但都没有找到解决方案。我希望找到一个像“从这里下载 swing API”这样的答案,但似乎没有办法做到这一点。无论如何,Maven 的项目属性没有用于导入库的 ClassPath 选项。我希望得到一些帮助来解决这个问题,因为说实话,我自己不知道该怎么做。

maven
  • 1 个回答
  • 28 Views
Martin Hope
user471011
Asked: 2024-09-24 03:42:36 +0800 CST

IntelliJ IDEA:加载 Maven 项目失败,并出现“java.net.SocketException:管道损坏”

  • 7

Intellij Idea成功识别到打开的项目是,Maven Project并显示一个带有按钮的弹出窗口Load Maven Project,但单击按钮后,什么也没有发生UI。 在此处输入图片描述

我检查了Intellij Idea日志文件,发现了多个这样的错误日志:

2024-09-23 21:28:20,439 [1325080] INFO - #ojimaven - 使用扩展 org.jetbrains.idea.maven.maven3.Maven3Support@59e87873 启动 MavenServer 2024-09-23 21:28:20,451 [1325092] INFO - #ojimaven - 已将令牌发送到 maven 服务器 2024-09-23 21:28:20,711 [1325352] WARN - #cierRemoteProcessSupport - 由于 java.net.SocketException:管道损坏,cook 无法启动 2024-09-23 21:28:20,753 [1325394] INFO - #cierRemoteProcessSupport - 正在终止: 127.0.0.1:61362/Maven36ServerImpl3157b954 2024-09-23 21:28:20,753 [1325394] INFO - STDERR - 线程“DefaultDispatcher-worker-14”中的异常 org.jetbrains.idea.maven.server.CannotStartServerException:java.util.concurrent.ExecutionException:java.rmi.ConnectIOException:JRMP 连接建立期间出错;嵌套异常为:2024-09-23 21:28:20,753 [1325394] INFO - STDERR - java.net.SocketException:管道损坏

似乎这些错误正是在我单击“加载 Maven 项目”按钮时引发的

关于如何修复它有什么想法吗?

我的环境如下:

  • IntelliJ IDEA 2024.2.2(终极版)
  • javac 21.0.4
  • Apache Maven 3.8.5
  • 苹果 M2 Pro
  • MacOS 红杉
maven
  • 1 个回答
  • 67 Views
Martin Hope
janci
Asked: 2024-09-10 21:44:39 +0800 CST

是否有 osgi.ee 包

  • 5

我一直在关注 Lars Vogel 的教程 [https://www.vogella.com/tutorials/EclipseTycho/article.html#google_vignette]。我目前被困在 RCP 插件项目的编译错误中: Software being installed: ... requires 'osgi.ee; (&(osgi.ee=JavaSE)(version=22))' but it could not be found。有很多关于它的讨论,但我还没有看到解决方案。我想知道 Eclipse 版本:版本:2024-06 (4.32.0) 是否有针对上述问题的解决方案。关于这个问题的大多数讨论都超出了我的理解范围。下面是我的聚合器 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.vogella.tycho</groupId>
    <artifactId>releng</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <properties>
        <tycho.version>4.0.8</tycho.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
    </properties>

    <!--repositories>
        <repository>
            <id>eclipse</id>
            <url>http://localhost:8080/site</url>
            <layout>p2</layout>
        </repository>

    </repositories-->
    <!--repositories>
    <repository>
      <id>my-repo1</id>
      <name>your custom repo</name>
      <url>https://mvnrepository.com/artifact/at.bestsolution.efxclipse.eclipse/javax.annotation</url>
    </repository-->


    <modules>
        <module>MyFeature</module>
        <module>MyPlugin</module>
        <module>updatesite</module>

    </modules>

    <dependencies>

        <!--
        https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api -->
        <!--dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency-->

        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <version>2.1.1</version>
            <scope>provided</scope>
        </dependency>
        <!--dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.annotation</artifactId>
            <version>3.0</version>
        </dependency-->
        <!-- https://mvnrepository.com/artifact/org.osgi.ee/ee.foundation -->
        <!-- https://mvnrepository.com/artifact/org.osgi/org.osgi.core -->
        <!-- https://mvnrepository.com/artifact/org.osgi.ee/ee.minimum -->


    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.tycho</groupId>
                    <artifactId>tycho-p2-director-plugin</artifactId>
                    <version>${tycho.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho.version}</version>
                <extensions>true</extensions>
            </plugin>
            <!--Enable the replacement of the SNAPSHOT version in the final product configuration-->
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-packaging-plugin</artifactId>
                <version>${tycho.version}</version>

                <executions>
                    <execution>
                        <phase>package</phase>
                        <id>package-feature</id>
                        <configuration>

                            <finalName>
                                ${project.artifactId}_${unqualifiedVersion}.${buildQualifier}</finalName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho.version}</version>
                <configuration>
                    <pomDependencies>wrapAsBundle</pomDependencies>
                    <!-- Optional set the Java version you are using-->
                    <executionEnvironment>JavaSE-21</executionEnvironment>
                    <target>
                        <file>../TargetDefinition/myTarget.target</file>
                    </target>
                    <environments>
                        <environment>
                            <os>linux</os>
                            <ws>gtk</ws>
                            <arch>x86_64</arch>
                        </environment>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86_64</arch>
                        </environment>
                        <environment>
                            <os>macosx</os>
                            <ws>cocoa</ws>
                            <arch>x86_64</arch>
                        </environment>
                    </environments>
                </configuration>
            </plugin>

        </plugins>
    </build>

</project>
maven
  • 1 个回答
  • 23 Views
Martin Hope
madx
Asked: 2024-09-05 02:58:59 +0800 CST

在 Jetty 12 上部署 Jakarta EE 应用程序:从 jetty-ee10-maven-plugin 到 Jetty 上的部署、ClassNotFoundException 和 CDIProvider 问题

  • 5

我有一个在 jetty 上运行的 jakarta ee 项目,我需要 cdi 和 faces。在开发过程中,我曾经通过jetty-ee10-maven-plugin运行 的插件来运行它mvn jetty:run。在本地执行mvn jetty:run可以正常工作,没有任何问题。

现在项目已经基本准备就绪,我相信导出 war 并将其部署到 jetty 网络服务器上12.0.4会很容易。

我的重要部分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.test</groupId>
    <artifactId>web</artifactId>
    <version>1.0.7</version>
    <packaging>war</packaging>
    <name>xyz_web</name>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <jetty.version>12.0.9</jetty.version>
        <jetty.port>8080</jetty.port>        
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>13.0.8</version>
            <classifier>jakarta</classifier>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.primefaces.extensions/primefaces-extensions -->
        <dependency>
            <groupId>org.primefaces.extensions</groupId>
            <artifactId>primefaces-extensions</artifactId>
            <version>13.0.8</version>
            <classifier>jakarta</classifier>
        </dependency>

        <!-- https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-api -->
        <dependency>
            <groupId>jakarta.platform</groupId>
            <artifactId>jakarta.jakartaee-api</artifactId>
            <version>${jakartaee-api.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>6.0.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/jakarta.inject/jakarta.inject-api -->
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
            <version>2.0.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/jakarta.ejb/jakarta.ejb-api -->
        <dependency>
            <groupId>jakarta.ejb</groupId>
            <artifactId>jakarta.ejb-api</artifactId>
            <version>4.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>jakarta.faces</artifactId>
            <version>4.0.5</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/jakarta.xml.bind/jakarta.xml.bind-api -->
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>4.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.jboss.weld.servlet</groupId>
            <artifactId>weld-servlet-core</artifactId>
            <version>5.1.2.Final</version>
            <exclusions>
                <exclusion>
                    <groupId>jakarta.el</groupId>
                    <artifactId>jakarta.el-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.omnifaces</groupId>
            <artifactId>omnifaces</artifactId>
            <version>4.3</version>
        </dependency>

        <!-- Other dependencies not related to jetty or server -->
        <!-- Other dependencies not related to jetty or server -->
        <!-- Other dependencies not related to jetty or server -->
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.12.1</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <release>${maven.compiler.release}</release>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.4.0</version>
                <configuration>
                    <webResources>
                        <resource>
                            <filtering>true</filtering>
                            <directory>src/main/webapp</directory>
                            <includes>
                                <include>**/web.xml</include>
                            </includes>
                        </resource>
                    </webResources>
                    <warSourceDirectory>src/main/webapp</warSourceDirectory>
                    <webXml>${project.build.directory}/web.xml</webXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty.ee10</groupId>
                <artifactId>jetty-ee10-maven-plugin</artifactId>
                <version>${jetty.version}</version>
                <configuration>
                    <!-- see https://eclipse.dev/jetty/documentation/jetty-12/programming-guide/index.html#jetty-run-goal -->
                    <webApp>
                        <contextPath>/</contextPath>
                    </webApp>
                    <scan>5</scan>
                    <webXml>${project.build.directory}/web.xml</webXml>
                    <httpConnector>
                        <host>0.0.0.0</host>
                        <port>${jetty.port}</port>
                        <idleTimeout>300000</idleTimeout>
                    </httpConnector>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.eclipse.jetty.ee10</groupId>
                        <artifactId>jetty-ee10-cdi</artifactId>
                        <version>${jetty.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>

        <!-- Parses all files in the specified directory and replaces properties expressions if found -->
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                <includes>
                    <include>web.xml</include>
                </includes>
                <filtering>true</filtering>
                <targetPath>${project.build.directory}</targetPath>
            </resource>
        </resources>
    </build>
</project>

当我在该云码头服务器上部署 war 文件时出现以下错误:

Caused by:
java.lang.ClassNotFoundException: jakarta.websocket.server.ServerContainer
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
at org.eclipse.jetty.ee10.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:496)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
at com.sun.faces.config.FacesInitializer.handleWebSocketConcerns(FacesInitializer.java:251)
at com.sun.faces.config.FacesInitializer.onStartup(FacesInitializer.java:123)
at org.eclipse.jetty.ee10.servlet.ServletContainerInitializerHolder.doStart(ServletContainerInitializerHolder.java:155)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.ee10.servlet.ServletContextHandler$ServletContainerInitializerStarter.doStart(ServletContextHandler.java:3041)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.ee10.servlet.ServletContextHandler.startContext(ServletContextHandler.java:1289)
at org.eclipse.jetty.ee10.webapp.WebAppContext.startContext(WebAppContext.java:1223)
at org.eclipse.jetty.ee10.servlet.ServletContextHandler.lambda$doStart$0(ServletContextHandler.java:1042)
at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.call(ContextHandler.java:1147)
at org.eclipse.jetty.ee10.servlet.ServletContextHandler.doStart(ServletContextHandler.java:1039)
at org.eclipse.jetty.ee10.webapp.WebAppContext.doStart(WebAppContext.java:496)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:40)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:183)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:522)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:162)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.pathAdded(ScanningAppProvider.java:293)
at org.eclipse.jetty.deploy.providers.ContextProvider.pathAdded(ContextProvider.java:520)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.pathAdded(ScanningAppProvider.java:69)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:902)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:868)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:775)
at org.eclipse.jetty.util.Scanner$ScanTask.run(Scanner.java:147)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)

因此,即使我不确定我是否尝试在内部添加此依赖项pom.xml。

<!-- Added to solve "java.lang.ClassNotFoundException: jakarta.websocket.server.ServerContainer" -->
<dependency>
    <groupId>org.glassfish.tyrus.bundles</groupId>
    <artifactId>tyrus-standalone-client</artifactId>
    <version>2.2.0</version>
</dependency>

现在我收到此错误:

java.lang.IllegalStateException: Unable to locate CDIProvider
at jakarta.enterprise.inject.spi.CDI.findAllProviders(CDI.java:139)
at jakarta.enterprise.inject.spi.CDI.getCDIProvider(CDI.java:92)
at jakarta.enterprise.inject.spi.CDI.current(CDI.java:65)
at org.jboss.weld.module.web.servlet.WeldInitialListener.contextInitialized(WeldInitialListener.java:89)
at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.contextInitialized(ForwardingServletListener.java:34)
at org.jboss.weld.environment.servlet.EnhancedListener.onStartup(EnhancedListener.java:70)
at org.eclipse.jetty.ee10.servlet.ServletContainerInitializerHolder.doStart(ServletContainerInitializerHolder.java:155)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.ee10.servlet.ServletContextHandler$ServletContainerInitializerStarter.doStart(ServletContextHandler.java:3041)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.ee10.servlet.ServletContextHandler.startContext(ServletContextHandler.java:1289)
at org.eclipse.jetty.ee10.webapp.WebAppContext.startContext(WebAppContext.java:1223)
at org.eclipse.jetty.ee10.servlet.ServletContextHandler.lambda$doStart$0(ServletContextHandler.java:1042)
at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.call(ContextHandler.java:1147)
at org.eclipse.jetty.ee10.servlet.ServletContextHandler.doStart(ServletContextHandler.java:1039)
at org.eclipse.jetty.ee10.webapp.WebAppContext.doStart(WebAppContext.java:496)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:40)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:183)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:522)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:162)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.pathAdded(ScanningAppProvider.java:293)
at org.eclipse.jetty.deploy.providers.ContextProvider.pathAdded(ContextProvider.java:520)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.pathAdded(ScanningAppProvider.java:69)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:902)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:868)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:775)
at org.eclipse.jetty.util.Scanner$ScanTask.run(Scanner.java:147)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)

我尝试了很多其他配置,添加了许多其他依赖项,但我找不到我所缺少的东西。

云端的Jetty服务器版本是12.0.4。我的Jetty Serverstart.ini文件如下:

#===========================================================
# Jetty Startup 
#===========================================================

# To disable the warning message, comment the following line
--module=home-base-warning

# --------------------------------------- 
# Module: ext
# Adds all jar files discovered in $JETTY_HOME/lib/ext
# and $JETTY_BASE/lib/ext to the servers classpath.
# --------------------------------------- 
--module=ext


# --------------------------------------- 
# Module: server
# Enables the core Jetty server on the classpath.
# --------------------------------------- 
--module=server

### Common HTTP configuration
## Scheme to use to build URIs for secure redirects
# jetty.httpConfig.secureScheme=https

## Port to use to build URIs for secure redirects
jetty.httpConfig.securePort=443

# --------------------------------------- 
# Module: jsp
# Enables JSP for all webapplications deployed on the server.
# --------------------------------------- 
--module=ee10-jsp
--module=ee9-jsp
--module=ee8-jsp


# --------------------------------------- 
# Module: resources
# Adds the $JETTY_HOME/resources and/or $JETTY_BASE/resources
# directory to the server classpath. Useful for configuration
# property files (eg jetty-logging.properties)
# --------------------------------------- 
--module=resources


# --------------------------------------- 
# Module: deploy
# Enables webapplication deployment from the webapps directory.
# --------------------------------------- 
--module=deploy
jetty.deploy.scanInterval=1

--module=ee10-deploy
jetty.deploy.scanInterval=1

--module=ee9-deploy
jetty.deploy.scanInterval=1

--module=ee8-deploy
jetty.deploy.scanInterval=1

# --------------------------------------- 
# Module: jstl
# Enables JSTL for all webapplications deployed on the server
# --------------------------------------- 
--module=ee10-jstl
--module=ee9-jstl
--module=ee8-jstl

# --------------------------------------- 
# Module: websocket
# Enable websockets for deployed web applications
# --------------------------------------- 
--module=websocket-jetty


# --------------------------------------- 
# Module: http
# Enables a HTTP connector on the server.
# By default HTTP/1 is support, but HTTP2C can
# be added to the connector with the http2c module.
# --------------------------------------- 
--module=http

### HTTP Connector Configuration

## Connector port to listen on
jetty.http.port=80

## HTTP Compliance: RFC7230, RFC7230_LEGACY, RFC2616, RFC2616_LEGACY, LEGACY or CUSTOMn
# jetty.http.compliance=RFC7230_LEGACY
# --------------------------------------- 
# Module: requestlog
# Enables a NCSA style request log.
# --------------------------------------- 
--module=requestlog

## Logging directory (relative to $jetty.base)
jetty.requestlog.dir=../../var/log/jetty

# --------------------------------------- 
# Module: gzip
# Enable GzipHandler for dynamic gzip compression
# for the entire server.
# --------------------------------------- 
--module=gzip
maven
  • 1 个回答
  • 19 Views
Martin Hope
user2460953
Asked: 2024-08-30 11:14:37 +0800 CST

Bazel 如何并行获取 Maven 父包?

  • 5

使用 gradle 的典型方法是一步下载所有需要的包,然后在下一步构建。但假设您有数百个 gradle 项目,并且不想一步下载所有需要的包。我假设 bazel 有办法缓存每个包,对吗?如果是这样,它如何处理可能具有相同父包的并行下载包?它们可能会尝试同时写入相同的文件并发生冲突,对吗?父级未列在锁定文件中,因此如果不手动解析 pom 文件,很难知道以什么顺序下载内容。

maven
  • 1 个回答
  • 38 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    重新格式化数字,在固定位置插入分隔符

    • 6 个回答
  • Marko Smith

    为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会?

    • 2 个回答
  • Marko Smith

    VScode 自动卸载扩展的问题(Material 主题)

    • 2 个回答
  • Marko Smith

    Vue 3:创建时出错“预期标识符但发现‘导入’”[重复]

    • 1 个回答
  • Marko Smith

    具有指定基础类型但没有枚举器的“枚举类”的用途是什么?

    • 1 个回答
  • Marko Smith

    如何修复未手动导入的模块的 MODULE_NOT_FOUND 错误?

    • 6 个回答
  • Marko Smith

    `(表达式,左值) = 右值` 在 C 或 C++ 中是有效的赋值吗?为什么有些编译器会接受/拒绝它?

    • 3 个回答
  • Marko Smith

    在 C++ 中,一个不执行任何操作的空程序需要 204KB 的堆,但在 C 中则不需要

    • 1 个回答
  • Marko Smith

    PowerBI 目前与 BigQuery 不兼容:Simba 驱动程序与 Windows 更新有关

    • 2 个回答
  • Marko Smith

    AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String”

    • 1 个回答
  • Martin Hope
    Fantastic Mr Fox msvc std::vector 实现中仅不接受可复制类型 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant 使用 chrono 查找下一个工作日 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor 构造函数的成员初始化程序可以包含另一个成员的初始化吗? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský 为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul C++20 是否进行了更改,允许从已知绑定数组“type(&)[N]”转换为未知绑定数组“type(&)[]”? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann 为什么 {2,3,10} 和 {x,3,10} (x=2) 的顺序不同? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller 在 5.2 版中,bash 条件语句中的 [[ .. ]] 中的分号现在是可选的吗? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench 为什么双破折号 (--) 会导致此 MariaDB 子句评估为 true? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng 为什么 `dict(id=1, **{'id': 2})` 有时会引发 `KeyError: 'id'` 而不是 TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String” 2024-03-20 03:12:31 +0800 CST

热门标签

python javascript c++ c# java typescript sql reactjs html

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve