Skip to content

Commit

Permalink
docs: clarify how to add annotation processor dependencies for Kotlin…
Browse files Browse the repository at this point in the history
… and Groovy projects. (#2910)

closes #2857
  • Loading branch information
wetted authored Apr 25, 2024
1 parent 2628b21 commit 2c5dd3b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ default Object getValue() {

/**
* @return Is expression value
* @see 4.5.0
* @since 4.5.0
*/
default boolean isExpression() {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/main/docs/guide/azureCosmos/azureCosmosQuickStart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ To get started with Micronaut Data Azure Cosmos add the following dependency to

dependency:io.micronaut.data:micronaut-data-document-processor[scope="annotationProcessor""]

NOTE: For Kotlin the dependency should be in the `kapt` scope and for Groovy it should be in `compileOnly` scope.
NOTE: For Kotlin, add the `micronaut-data-document-processor` dependency in https://docs.micronaut.io/4.4.3/guide/#kaptOrKsp[kapt or ksp scope], and for Groovy add `micronaut-data-document-processor` in compileOnly scope.

You should then configure a compile-scoped dependency on the `micronaut-data-azure-cosmos` module:

Expand Down
2 changes: 2 additions & 0 deletions src/main/docs/guide/buildConfig.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ For document databases like <<mongo, MongoDB>> or <<azureCosmos, Azure Cosmos Da

dependency:io.micronaut.data:micronaut-data-document-processor[scope="annotationProcessor"]

NOTE: For Kotlin, add the `micronaut-data-processor` or `micronaut-data-document-processor` dependency in https://docs.micronaut.io/4.4.3/guide/#kaptOrKsp[kapt or ksp scope], and for Groovy add `micronaut-data-processor` or `micronaut-data-document-processor` in compileOnly scope.

You can use Micronaut Launch to create a pre-configured project:

[cols=3*]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ To configure the metamodel generator simply add the following dependency to the

dependency:hibernate-jpamodelgen-jakarta[groupId="org.hibernate", scope="annotationProcessor"]

NOTE: The Hibernate 6 version of `hibernate-jpamodelgen-jakarta` is required because prior versions of Hibernate are still using the `javax.persistence` package
NOTE: The Hibernate 6 version of `hibernate-jpamodelgen-jakarta` is required because prior versions of Hibernate are still using the `javax.persistence` package.
For Kotlin, add the dependency in https://docs.micronaut.io/4.4.3/guide/#kaptOrKsp[kapt or ksp scope], and for Groovy add it in compileOnly scope.


And we need to include the generated classes on the Java classpath to have them accessible:

Expand Down
2 changes: 1 addition & 1 deletion src/main/docs/guide/dbc/jdbc/jdbcQuickStart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The annotation processor needs to have the Micronaut Data processor dependency p

dependency:io.micronaut.data:micronaut-data-processor[scope="annotationProcessor"]

NOTE: For Kotlin the dependency should be in the `kapt` scope and for Groovy it should be in `compileOnly` scope.
NOTE: For Kotlin, add the `micronaut-data-processor` dependency in https://docs.micronaut.io/4.4.3/guide/#kaptOrKsp[kapt or ksp scope], and for Groovy add `micronaut-data-processor` in compileOnly scope.

Next up you need to configure at least one data source. The following snippet from the application configuration file is an example of configuring the default JDBC data source:

Expand Down
2 changes: 1 addition & 1 deletion src/main/docs/guide/mongo/mongoQuickStart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ To get started with Micronaut Data MongoDB add the following dependency to your

dependency:io.micronaut.data:micronaut-data-document-processor[scope="annotationProcessor""]

NOTE: For Kotlin the dependency should be in the `kapt` scope and for Groovy it should be in `compileOnly` scope.
NOTE: For Kotlin, add the `micronaut-data-document-processor` dependency in https://docs.micronaut.io/4.4.3/guide/#kaptOrKsp[kapt or ksp scope], and for Groovy add `micronaut-data-document-processor` in compileOnly scope.

You should then configure a compile-scoped dependency on the `micronaut-data-mongodb` module:

Expand Down

0 comments on commit 2c5dd3b

Please sign in to comment.