MySQL 드라이버 종속성

AEM as a Cloud Service에서는 종종 연결을 지원하기 위해 Java™ 데이터베이스 드라이버를 제공해야 합니다. 드라이버를 제공하는 것은 일반적으로 이러한 드라이버가 포함된 OSGi 번들 아티팩트를 all 패키지를 통해 AEM 프로젝트에 포함시켜 가장 잘 수행됩니다.

Reactor pom.xml

데이터베이스 드라이버 종속성을 pom.xml 반응기에 포함한 다음 all 하위 프로젝트에서 참조합니다.

  • pom.xml
...
<dependencies>
    ...
    <!-- MySQL Driver dependencies -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>[8.0.27,)</version>
        <scope>provided</scope>
    </dependency>
    ...
</dependencies>
...

모든 pom.xml

데이터베이스 드라이버 종속성 아티팩트를 AEM as a Cloud Service에 배포하고 사용할 수 있도록 all 패키지에 포함하십시오. 이러한 아티팩트 must ​은(는) 데이터베이스 드라이버 Java™ 클래스를 내보내는 OSGi 번들입니다.

  • all/pom.xml
...
<embededs>
    ...
    <!-- Include the MySQL Driver OSGi bundles for deployment to the project -->
    <embedded>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <target>/apps/wknd-examples-vendor-packages/application/install</target>
    </embedded>
    ...
</embededs>

...

<dependencies>
    ...
    <!-- Add MySQL OSGi bundle artifacts so the <embeddeds> can add them to the project -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>provided</scope>
    </dependency>
    ...
</dependencies>
...
recommendation-more-help