Skip to content

Commit e02ca82

Browse files
authored
Merge pull request #1093 from hazendaz/master
[pom] Wire in necessary logic to generate javadocs for groovy and kotlin
2 parents a2866e8 + c7c9252 commit e02ca82

File tree

2 files changed

+105
-3
lines changed
  • mybatis-spring-boot-samples
    • mybatis-spring-boot-sample-groovy
    • mybatis-spring-boot-sample-kotlin

2 files changed

+105
-3
lines changed

mybatis-spring-boot-samples/mybatis-spring-boot-sample-groovy/pom.xml

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,23 @@
2929
<properties>
3030
<module.name>org.mybatis.spring.boot.sample.groovy</module.name>
3131
<groovy.version>4.0.27</groovy.version>
32+
<sourceDirectory>${project.basedir}/src/main/groovy</sourceDirectory>
33+
<testSourceDirectory>${project.basedir}/src/test/groovy</testSourceDirectory>
3234
</properties>
35+
36+
<dependencyManagement>
37+
<dependencies>
38+
<!-- Ensure we use latest version regardless of spotbugs version -->
39+
<dependency>
40+
<groupId>org.apache.groovy</groupId>
41+
<artifactId>groovy-bom</artifactId>
42+
<version>${groovy.version}</version>
43+
<type>pom</type>
44+
<scope>import</scope>
45+
</dependency>
46+
</dependencies>
47+
</dependencyManagement>
48+
3349
<dependencies>
3450
<dependency>
3551
<groupId>org.mybatis.spring.boot</groupId>
@@ -43,7 +59,16 @@
4359
<dependency>
4460
<groupId>org.apache.groovy</groupId>
4561
<artifactId>groovy</artifactId>
46-
<version>${groovy.version}</version>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.apache.groovy</groupId>
65+
<artifactId>groovy-groovydoc</artifactId>
66+
<optional>true</optional>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.apache.groovy</groupId>
70+
<artifactId>groovy-docgenerator</artifactId>
71+
<optional>true</optional>
4772
</dependency>
4873
<!-- test dependencies -->
4974
<dependency>
@@ -88,6 +113,13 @@
88113
<groupId>org.codehaus.gmavenplus</groupId>
89114
<artifactId>gmavenplus-plugin</artifactId>
90115
<version>4.2.1</version>
116+
<configuration>
117+
<attachGroovyDocAnnotation>true</attachGroovyDocAnnotation>
118+
<docTitle>${project.name} Groovy Documentation</docTitle>
119+
<groovyDocOutputDirectory>${project.reporting.outputDirectory}/gapidocs</groovyDocOutputDirectory>
120+
<footer>${project.name} Groovy Documentation</footer>
121+
<header>${project.name} Groovy Documentation</header>
122+
</configuration>
91123
<executions>
92124
<execution>
93125
<goals>
@@ -104,7 +136,47 @@
104136
</executions>
105137
</plugin>
106138
</plugins>
107-
<sourceDirectory>${project.basedir}/src/main/groovy</sourceDirectory>
108-
<testSourceDirectory>${project.basedir}/src/test/groovy</testSourceDirectory>
109139
</build>
140+
141+
<profiles>
142+
<profile>
143+
<id>release</id>
144+
<build>
145+
<plugins>
146+
<plugin>
147+
<groupId>org.codehaus.gmavenplus</groupId>
148+
<artifactId>gmavenplus-plugin</artifactId>
149+
<executions>
150+
<execution>
151+
<id>groovydocs</id>
152+
<goals>
153+
<goal>generateStubs</goal>
154+
<goal>generateTestStubs</goal>
155+
<goal>groovydoc</goal>
156+
</goals>
157+
</execution>
158+
</executions>
159+
</plugin>
160+
<plugin>
161+
<groupId>org.apache.maven.plugins</groupId>
162+
<artifactId>maven-jar-plugin</artifactId>
163+
<executions>
164+
<execution>
165+
<id>groovydoc-jar</id>
166+
<goals>
167+
<goal>jar</goal>
168+
</goals>
169+
<phase>package</phase>
170+
<configuration>
171+
<classifier>javadoc</classifier>
172+
<classesDirectory>${project.reporting.outputDirectory}/gapidocs</classesDirectory>
173+
</configuration>
174+
</execution>
175+
</executions>
176+
</plugin>
177+
</plugins>
178+
</build>
179+
</profile>
180+
</profiles>
181+
110182
</project>

mybatis-spring-boot-samples/mybatis-spring-boot-sample-kotlin/pom.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,34 @@
116116
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
117117
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
118118
</build>
119+
120+
<profiles>
121+
<profile>
122+
<id>release</id>
123+
<build>
124+
<plugins>
125+
<plugin>
126+
<groupId>org.jetbrains.dokka</groupId>
127+
<artifactId>dokka-maven-plugin</artifactId>
128+
<version>2.0.0</version>
129+
<configuration>
130+
<classifier>javadoc</classifier>
131+
<classesDirectory>${project.build.directory}/dokka/javadoc</classesDirectory>
132+
</configuration>
133+
<executions>
134+
<execution>
135+
<id>attach-dokka-javadoc</id>
136+
<goals>
137+
<goal>javadoc</goal>
138+
<goal>javadocJar</goal>
139+
</goals>
140+
<phase>package</phase>
141+
</execution>
142+
</executions>
143+
</plugin>
144+
</plugins>
145+
</build>
146+
</profile>
147+
</profiles>
148+
119149
</project>

0 commit comments

Comments
 (0)