<i id='SxL65'><tr id='SxL65'><dt id='SxL65'><q id='SxL65'><span id='SxL65'><b id='SxL65'><form id='SxL65'><ins id='SxL65'></ins><ul id='SxL65'></ul><sub id='SxL65'></sub></form><legend id='SxL65'></legend><bdo id='SxL65'><pre id='SxL65'><center id='SxL65'></center></pre></bdo></b><th id='SxL65'></th></span></q></dt></tr></i><div id='SxL65'><tfoot id='SxL65'></tfoot><dl id='SxL65'><fieldset id='SxL65'></fieldset></dl></div>
  • <small id='SxL65'></small><noframes id='SxL65'>

    <tfoot id='SxL65'></tfoot>
    <legend id='SxL65'><style id='SxL65'><dir id='SxL65'><q id='SxL65'></q></dir></style></legend>

        • <bdo id='SxL65'></bdo><ul id='SxL65'></ul>

        如何替换 Maven 依赖项的类?

        时间:2023-07-14
        <i id='0qFFz'><tr id='0qFFz'><dt id='0qFFz'><q id='0qFFz'><span id='0qFFz'><b id='0qFFz'><form id='0qFFz'><ins id='0qFFz'></ins><ul id='0qFFz'></ul><sub id='0qFFz'></sub></form><legend id='0qFFz'></legend><bdo id='0qFFz'><pre id='0qFFz'><center id='0qFFz'></center></pre></bdo></b><th id='0qFFz'></th></span></q></dt></tr></i><div id='0qFFz'><tfoot id='0qFFz'></tfoot><dl id='0qFFz'><fieldset id='0qFFz'></fieldset></dl></div>
          <tbody id='0qFFz'></tbody>
      1. <legend id='0qFFz'><style id='0qFFz'><dir id='0qFFz'><q id='0qFFz'></q></dir></style></legend>
          <bdo id='0qFFz'></bdo><ul id='0qFFz'></ul>
            <tfoot id='0qFFz'></tfoot>

            <small id='0qFFz'></small><noframes id='0qFFz'>

                • 本文介绍了如何替换 Maven 依赖项的类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  maven 依赖中有一个类与 Java 8 不兼容.

                  There is a class in a maven dependency that is incompatible with Java 8.

                  您如何正确解决该问题?

                  How do you properly fix that problem?

                  现在我正在做以下事情:

                  Right now I'm doing the following:

                  1. 创建一个同名的包
                  2. 在该包中创建一个同名的类
                  3. 复制并粘贴代码
                  4. 修复不兼容的 API 调用

                  问题是这个类包含对受限类的 API 调用,尽管我更改了 Eclipse 编译器设置(Window -> Preferences -> Java -> Compiler -> Error/Warnings -> Deprecated and restricted API -> Forbidden reference (访问规则):错误->警告)允许访问该项目有时只会编译.如果它没有编译,我会得到一个找不到符号"的错误.

                  The problem is that this class contains API calls to restricted classes and although I changed the Eclipse compiler settings (Window -> Preferences -> Java -> Compiler -> Error/Warnings -> Deprecated and restricted API -> Forbidden reference (access rule): Error -> Warning) to allow access the project will only compile sometimes. If it doesn't compile I'll get a "can't find symbol" error.

                  以下是您要求的详细信息:

                  Here are the details you asked for:

                  • 依赖:http://mvnrepository.com/artifact/com.sun.xml.wss/xws-security/3.0

                  类:加密处理器

                  必要的改变:

                  // Change line 1053 FROM: 
                  // _dataEncryptor = XMLCipher.getInstance(dataEncAlgo, _dataCipher); 
                  // TO:
                  _dataEncryptor = XMLCipher.getInstance(dataEncAlgo); 
                  

                  Edit-2:

                  Maven 构建错误:

                  Maven build error:

                   [ERROR] symbol:   class XMLCipher
                   [ERROR] location: class com.sun.xml.wss.impl.apachecrypto.EncryptionProcessor
                   [ERROR] /C:/Users/{name}/development/eclipse_workspace/git/xws-security/src/main/java/com/sun/xml/wss/impl/apachecrypto/EncryptionProcessor.java:[1482,98] cannot find symbol
                  

                  推荐答案

                  一般解决方案:

                  • 下载所有项目源代码
                  • 应用您的修改
                    • 使用版本控制,以免丢失更改

                    这篇关于如何替换 Maven 依赖项的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Maven-shade-plugin、uber-jar 和重叠类 下一篇:Gradle:如何从 JScience jar 依赖项中排除 javax.realtime 包(多个 dex 定义)

                  相关文章

                • <i id='gpaRt'><tr id='gpaRt'><dt id='gpaRt'><q id='gpaRt'><span id='gpaRt'><b id='gpaRt'><form id='gpaRt'><ins id='gpaRt'></ins><ul id='gpaRt'></ul><sub id='gpaRt'></sub></form><legend id='gpaRt'></legend><bdo id='gpaRt'><pre id='gpaRt'><center id='gpaRt'></center></pre></bdo></b><th id='gpaRt'></th></span></q></dt></tr></i><div id='gpaRt'><tfoot id='gpaRt'></tfoot><dl id='gpaRt'><fieldset id='gpaRt'></fieldset></dl></div>

                    <tfoot id='gpaRt'></tfoot>
                  1. <legend id='gpaRt'><style id='gpaRt'><dir id='gpaRt'><q id='gpaRt'></q></dir></style></legend>

                        <bdo id='gpaRt'></bdo><ul id='gpaRt'></ul>
                    1. <small id='gpaRt'></small><noframes id='gpaRt'>