解决maven编译错误:程序包com.sun.xml.internal.ws.spi不存在

解决方法如下:

添加maven-compiler-plugin插件,并且配置compilerArguments

如:

复制代码
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <compilerArguments>
            <bootclasspath>${JAVA_HOME}/jre/lib/rt.jar</bootclasspath>
        </compilerArguments>
    </configuration>
</plugin>

注意:

1:这里的rt.jar需要配置正确的路径

2:如果使用的类,接口等在其他的jar里面(如tools.jar),则bootclasspath值需要配置成其他的jar

配置好之后,再编译打包,就没有问题了

相关推荐
集成显卡26 分钟前
使用 Google 开源 AI 工具 LangExtract 进行结构化信息抽取
python·google·openai
久笙&35 分钟前
对象存储解决方案:MinIO 的架构与代码实战
数据库·python·架构
不甘懦弱1 小时前
阿里云搭建flask服务器
服务器·python·flask
赵英英俊1 小时前
Python day51
人工智能·pytorch·python
律品1 小时前
pytest的前置与后置
开发语言·python·pytest
飞翔的佩奇1 小时前
【完整源码+数据集+部署教程】遥感森林砍伐检测系统源码和数据集:改进yolo11-SWC
python·yolo·计算机视觉·数据集·yolo11·遥感森林砍伐检测
阿汤哥的程序之路2 小时前
Python如何将两个列表转化为一个字典
python
RabbitYao2 小时前
Android 项目 通过 AndroidStringsTool 更新多语言词条
android·python
RabbitYao2 小时前
使用 Gemini 及 Python 更新 Android 多语言 Excel 文件
android·python
天天进步20152 小时前
Python机器学习入门:用scikit-learn构建你的第一个预测模型
python·机器学习·scikit-learn