Skip to content

Commit 2d037e2

Browse files
authored
Add a description of Maven (#612)
1 parent 045fefd commit 2d037e2

File tree

2 files changed

+61
-6
lines changed

2 files changed

+61
-6
lines changed

README.md

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,27 +92,72 @@ For more complete examples,
9292
see [simple-examples](https://github.com/domaframework/simple-examples)
9393
and [spring-boot-jpetstore](https://github.com/domaframework/spring-boot-jpetstore).
9494

95-
Build with Gradle
96-
-----------------
95+
Installing
96+
----------
97+
98+
### Gradle
9799

98100
For Java projects:
99101

100102
```groovy
101103
dependencies {
102-
implementation "org.seasar.doma:doma-core:2.43.0"
103-
annotationProcessor "org.seasar.doma:doma-processor:2.43.0"
104+
implementation("org.seasar.doma:doma-core:2.43.0")
105+
annotationProcessor("org.seasar.doma:doma-processor:2.43.0")
104106
}
105107
```
106108

107109
For Kotlin projects, use doma-kotlin instead of doma-core and use kapt in place of annotationProcessor:
108110

109111
```groovy
110112
dependencies {
111-
implementation "org.seasar.doma:doma-kotlin:2.43.0"
112-
kapt "org.seasar.doma:doma-processor:2.43.0"
113+
implementation("org.seasar.doma:doma-kotlin:2.43.0")
114+
kapt("org.seasar.doma:doma-processor:2.43.0")
113115
}
114116
```
115117

118+
### Maven
119+
120+
We recommend using Gradle, but if you want to use Maven, see below.
121+
122+
For Java projects:
123+
124+
```xml
125+
...
126+
<properties>
127+
<org.seasar.doma.version>2.43.0</org.seasar.doma.version>
128+
</properties>
129+
...
130+
<dependencies>
131+
<dependency>
132+
<groupId>org.seasar.doma</groupId>
133+
<artifactId>doma-core</artifactId>
134+
<version>${org.seasar.doma.version}</version>
135+
</dependency>
136+
</dependencies>
137+
...
138+
<build>
139+
<plugins>
140+
<plugin>
141+
<groupId>org.apache.maven.plugins</groupId>
142+
<artifactId>maven-compiler-plugin</artifactId>
143+
<version>3.8.1</version>
144+
<configuration>
145+
<source>1.8</source> <!-- depending on your project -->
146+
<target>1.8</target> <!-- depending on your project -->
147+
<annotationProcessorPaths>
148+
<path>
149+
<groupId>org.seasar.doma</groupId>
150+
<artifactId>doma-processor</artifactId>
151+
<version>${doma.version}</version>
152+
</path>
153+
</annotationProcessorPaths>
154+
</configuration>
155+
</plugin>
156+
</plugins>
157+
</build>
158+
```
159+
160+
For Kotlin projects, see [Kotlin document](https://kotlinlang.org/docs/reference/kapt.html#using-in-maven).
116161

117162
Documentation
118163
---------------------

build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,16 @@ rootProject.apply {
202202
}
203203
}
204204
}
205+
ant.withGroovyBuilder {
206+
"replaceregexp"("match" to """(<org.seasar.doma.version>)[^<]*(</org.seasar.doma.version>)""",
207+
"replace" to "\\1${ver}\\2",
208+
"encoding" to encoding,
209+
"flags" to "g") {
210+
"fileset"("dir" to ".") {
211+
"include"("name" to "README.md")
212+
}
213+
}
214+
}
205215
}
206216

207217
tasks {

0 commit comments

Comments
 (0)