Azure KeyVault库,到Atlassian Confluence插件POM.xml

发布于 2025-02-12 23:25:38 字数 1916 浏览 0 评论 0原文

我正在尝试将这两个教程结合在一起 - 汇合处Hello World Macro& Azure KeyVault快速启动: https://developer.atlassian.com/server/framework/atlassian-sdk/create-a-confluence-hello-world-macro/

https://learn.microsoft.com/en-us/azure/key-vault/secrets/quick-create-java?tabs=azure-cli

在将2个Azure依赖性添加到POM之后.xml的Maven项目和运行Atlas-Mvn Clean Package我收到了一条有关3个禁止依赖项的错误消息。 我在Maven门户网站上寻找最新的Azure包。然后将其简化为一个。

发现禁止的依赖性:org.slf4j:slf4j-api:jar:1.7.25

然后,我在依赖项部分中添加了添加的排除措施:

这导致构建成功运行,但是,Confluence插件会产生运行时错误: java.lang.noclassdeffounderror 线程“ main” java.lang.noclassdeffounderror中的异常:org/slf4j/logger com.azure.security.keyvault.secrets.secretclientbuilder。

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-security-keyvault-secrets</artifactId>
    <version>4.3.0</version>
    <exclusions>
        <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-identity</artifactId>
    <version>1.4.0</version>
    <exclusions>
        <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </exclusion>
    </exclusions>
</dependency>

I am trying to combine these 2 tutorials - Confluence Hello World Macro & Azure keyvault quick start:
https://developer.atlassian.com/server/framework/atlassian-sdk/create-a-confluence-hello-world-macro/

https://learn.microsoft.com/en-us/azure/key-vault/secrets/quick-create-java?tabs=azure-cli

After having added the 2 Azure dependencies to the pom.xml of the maven project and running atlas-mvn clean package I receive an error message about 3 banned dependencies.
I looked for the newest Azure packages at the maven portal. Then it was reduced to one.

Found Banned Dependency: org.slf4j:slf4j-api:jar:1.7.25

Then I added added exclusions to the dependency section:

This resulted that the build ran successfully, however, the Confluence plugin produces a runtime error:
java.lang.NoClassDefFoundError
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger
at com.azure.security.keyvault.secrets.SecretClientBuilder.(SecretClientBuilder.java:110)

Can you please help, how can I achieve this?

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-security-keyvault-secrets</artifactId>
    <version>4.3.0</version>
    <exclusions>
        <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-identity</artifactId>
    <version>1.4.0</version>
    <exclusions>
        <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </exclusion>
    </exclusions>
</dependency>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

羞稚 2025-02-19 23:25:38

错误:java.lang.noclassDeffoundError在线程“ main” java.lang.noclassdeffounderror中的异常:org/slf4j/logger在com.azure.security.security.keyvault.secret.secrets.secrets.secrets.secrets.secrets.secrets.secrets.secretclientbuilder。 >

。找不到应用程序路径中的org/slf4j/logger类。此错误的最简单原因是缺少 slf4j.jar 文件。

  • 如果问题是由于丢失的slf4j.jar文件引起的,则可以通过在路径中添加相关版本的slf4j.jar来修复它。
  • 使用最新版本的JAR,其中应添加的JAR文件的版本取决于应用程序。

在Maven中,您还可以在pom.xml文件中添加以下依赖关系以下载sl4j.jar

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.36</version>
</dependency>

参考

error: java.lang.NoClassDefFoundError Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger at com.azure.security.keyvault.secrets.SecretClientBuilder.(SecretClientBuilder.java:110)

The above error indicates that JVM is not able to found org/slf4j/Logger class in your application's path.The simplest reason for this error is the missing Slf4j.jar file.

  • If the problem is caused due to the missing slf4j.jar file then you can fix it by adding a relevant version of slf4j.jar into your path.
  • Use the latest version of the jar in which version of the JAR file you should add will depend upon the application.

In Maven , you can also add the following dependency in your pom.xml file to download sl4j.jar

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.36</version>
</dependency>

Reference:
java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory - Stack Overflow

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文