简体   繁体   English

如何为 azure java sdk 使用“com.azure”包

[英]How to use "com.azure" package for azure java sdk

It's specified in this page https://github.com/Azure/azure-sdk-for-java ,它在此页面https://github.com/Azure/azure-sdk-for-java 中指定,

Java 8 or later is required to use libraries under the com.azure package, for libraries under the com.microsoft.azure package Java 7 or later is required.

Does that mean I should add dependencies like这是否意味着我应该添加依赖项

    <dependency>
      <groupId>com.azure</groupId>
      <artifactId>azure</artifactId>
      <version>1.31.1</version>
    </dependency>

Not <groupId>com.microsoft.azure</groupId> anymore?不再是<groupId>com.microsoft.azure</groupId>

Well, I downloaded this sample, https://github.com/Azure-Samples/Hybrid-resources-java-manage-resource-group.git , and changed all com.microsoft.azure to com.azure , but it did not work...好吧,我下载了这个示例https://github.com/Azure-Samples/Hybrid-resources-java-manage-resource-group.git ,并将所有com.microsoft.azure更改为com.azure ,但它没有工作...

The azure artifact is part of com.microsoft.azure group. azure工件是com.microsoft.azure组的一部分。 So, you should continue to use this group.所以,你应该继续使用这个组。 See https://search.maven.org/artifact/com.microsoft.azure/azure/1.31.1/jar请参阅https://search.maven.org/artifact/com.microsoft.azure/azure/1.31.1/jar

<dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure</artifactId>
  <version>1.31.1</version>
</dependency>

The new packages released under com.azure group follow new design guidelines .com.azure组下发布的新包遵循新的设计准则

You can find more details on all available packages (old and new) here .您可以在 此处找到有关所有可用软件包(旧的和新的)的更多详细信息。

Available packages可用包

Each service might have a number of libraries available from each of the following categories:每个服务可能有许多可用的库,这些库来自以下每个类别:

  • Client: New Releases客户:新版本
  • Client: Previous Versions客户:以前的版本
  • Management: New Releases管理:新版本
  • Management: Previous Versions管理:以前的版本

Client: New Releases客户:新版本

New wave of packages that follow the Azure SDK Design Guidelines for Java and share a number of core features such as HTTP retries, logging, transport protocols, authentication protocols, etc., so that once you learn how to use these features in one client library, you will know how to use them in other client libraries.遵循适用于 JavaAzure SDK 设计指南并共享许多核心功能(例如 HTTP 重试、日志记录、传输协议、身份验证协议等)的新一波包,因此一旦您学会如何在一个客户端库中使用这些功能,您将知道如何在其他客户端库中使用它们。 You can learn about these shared features here .您可以在此处了解这些共享功能。 These libraries can be easily identified by folder, package, and namespaces names starting with azure- , eg azure-keyvault .这些库可以通过以azure-开头的文件夹、包和命名空间名称轻松识别,例如azure-keyvault

You can find the most up to date list of all of the new packages on our page .您可以在我们的页面上找到所有新软件包的最新列表 This list includes the most recent releases: both GA and preview.此列表包括最新版本:GA 和预览版。

NOTE: If you need to ensure your code is ready for production use one of the stable, non-preview libraries.注意:如果您需要确保您的代码已准备好用于生产,请使用稳定的非预览库之一。

Client: Previous Versions客户:以前的版本

Last stable versions of packages that have been provided for usage with Azure and are production-ready.已提供用于 Azure 且可用于生产的包的最新稳定版本。 These libraries provide similar functionalities to the new libraries, as they allow you to use and consume existing resources and interact with them, for example: upload a blob.这些库提供与新库类似的功能,因为它们允许您使用和使用现有资源并与之交互,例如:上传 blob。 Previous library directories start with microsoft-azure- , eg microsoft-azure-keyvault .以前的库目录以microsoft-azure- ,例如microsoft-azure-keyvault They might not implement the guidelines or have the same feature set as the new releases.他们可能不会实施指南或具有与新版本相同的功能集。 They do however offer wider coverage of services.然而,它们确实提供更广泛的服务。

Management: New Releases A new set of management libraries that follow the [Azure SDK Design Guidelines for管理:新版本 一组新的管理库遵循 [Azure SDK Design Guidelines for

Java]( https://azure.github.io/azure-sdk/java/guidelines/ ) are now in Public Preview. Java]( https://azure.github.io/azure-sdk/java/guidelines/ ) 现在是公共预览版。 These new libraries provide a higher-level, object-oriented API for managing Azure resources, that is optimized for ease of use, succinctness and consistency.这些新库提供了用于管理Azure 资源的更高级别、面向对象的 API,该 API 针对易用性、简洁性和一致性进行了优化。 You can find the list of new packages on this page .您可以在此页面上找到新软件包的列表。 Documentation and code samples for these new libraries can be found here可以在此处找到这些新库的文档和代码示例

NOTE: If you need to ensure your code is ready for production use one of the stable, non-preview libraries.注意:如果您需要确保您的代码已准备好用于生产,请使用稳定的非预览库之一。

Management: Previous Versions For a complete list of management libraries which enable you to provision and manage Azure resources,管理:以前的版本 有关使您能够配置和管理 Azure 资源的管理库的完整列表,

please checkhere .请检查这里 They might not have the same feature set as the new releases but they do offer wider coverage of services.它们可能没有与新版本相同的功能集,但它们确实提供了更广泛的服务覆盖范围。 Management libraries can be identified by namespaces that start with azure-mgmt- , eg azure-mgmt-compute管理库可以通过以azure-mgmt-开头的命名空间来标识,例如azure-mgmt-compute

For a full list of all Azure SDK releases, checkthis page .有关所有 Azure SDK 版本的完整列表,请查看此页面

Please check this section on Java releases.请查看有关 Java 版本的此部分

Note that the newer version of com.azure.resourcemanager:azure:azure-resourcemanager is still in preview stage.请注意,较新版本的 com.azure.resourcemanager:azure:azure-resourcemanager 仍处于预览阶段。 You do not want to take it into your production system, yet.您还不想将它带入您的生产系统。

If you do not intend to use resourcemanager lib with other com.azure libs, you can safely continue using com.microsoft.azure:azure until above get GAed.如果您不打算将 resourcemanager 库与其他 com.azure 库一起使用,您可以安全地继续使用 com.microsoft.azure:azure 直到上面获得 GAed。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM