Java 未注册Azure KeyVault的服务或属性
我和一个朋友有问题Java 未注册Azure KeyVault的服务或属性,java,azure,azure-keyvault,Java,Azure,Azure Keyvault,我和一个朋友有问题 Exception in thread "main" java.lang.RuntimeException: Service or property not registered: com.microsoft.azure.keyvault.KeyVaultClient class org.apache.http.impl.client.HttpClientBuilder 我看着 servicebus也遇到了同样的问题。然而,我试图遮住我的罐子,但仍然没有解决问题 是否有
Exception in thread "main" java.lang.RuntimeException: Service or property not registered: com.microsoft.azure.keyvault.KeyVaultClient class org.apache.http.impl.client.HttpClientBuilder
我看着
servicebus也遇到了同样的问题。然而,我试图遮住我的罐子,但仍然没有解决问题
是否有已知的修复方法
我的构建如下所示:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<source>1.7</source>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.App</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
是否要使用Maven导出可运行的jar文件?还是同时使用Eclipse?可以参考SO线程,这很有帮助。如果在Maven中使用Eclipse,请不要忘记启用
将所需库打包到生成的JAR
选项。我应该做些不同的事情吗?请按照SO线程的答案尝试修改您的pom.xml
文件以解决您的问题。在您共享的GitHub问题中,提到了中的解释和解决方法,这可能会有所帮助。
exception in thread "main" java.lang.RuntimeException: Service or property not registered: com.microsoft.azure.keyvault.KeyVaultClient class org.apache.http.impl.client.HttpClientBuilder
at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:198)
at com.microsoft.windowsazure.core.DefaultBuilder$1.create(DefaultBuilder.java:138)
at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
at com.microsoft.windowsazure.Configuration.create(Configuration.java:113)
at com.microsoft.azure.keyvault.KeyVaultClientService.create(KeyVaultClientService.java:48)
at com.microsoft.ac.configuration.KeyVaultHelper.initialize(KeyVaultHelper.java:27)
at com.microsoft.ac.App.main(App.java:21)