Skip to content

Commit dc449b3

Browse files
committed
goal init, flavour springboot-3 added eager init example #269
1 parent 6a7e099 commit dc449b3

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- quarkus-version set to 3.17.4 across al the modules
1313
- [fj-doc-maven-plugin] micronaut flavour version set to 4.7.2
1414
- [fj-doc-maven-plugin] goal init, flavour quarkus-3 added eager init example #270
15-
15+
- [fj-doc-maven-plugin] goal init, flavour springboot-3 added eager init example #269
1616

1717
## [8.11.5] - 2024-12-06
1818

fj-doc-maven-plugin/src/main/resources/config/template/flavour/springboot-3-fm-yml.ftl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ process:
1717
- from: flavour/${context.flavour}/SpringbootApplicationTests.ftl
1818
to: ${context.projectFolder}/src/test/java/test/<@fhm.toProjectPackageFolder context=context/>/${context.artifactIdAsClassName}ApplicationTests.java
1919
- from: flavour/${context.flavour}/application.ftl
20-
to: ${context.projectFolder}/src/main/resources/application.yaml
20+
to: ${context.projectFolder}/src/main/resources/application.yaml
21+
- from: flavour/${context.flavour}/AppInit.ftl
22+
to: ${context.projectFolder}/src/main/java/<@fhm.toProjectPackageFolder context=context/>/AppInit.java
23+
- from: flavour/${context.flavour}/DocHelper.ftl
24+
to: ${context.projectFolder}/src/main/java/<@fhm.toProjectPackageFolder context=context/>/DocHelper.java
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<#import '../flavour-macro.ftl' as fhm>
2+
package <@fhm.toProjectPackage context=context/>;
3+
4+
import lombok.extern.slf4j.Slf4j;
5+
import org.springframework.beans.factory.InitializingBean;
6+
import org.springframework.beans.factory.annotation.Autowired;
7+
import org.springframework.stereotype.Component;
8+
import org.fugerit.java.doc.base.config.InitHandler;
9+
@Slf4j
10+
public class AppInit implements InitializingBean {
11+
12+
@Autowired
13+
DocHelper docHelper;
14+
15+
@Override
16+
public void afterPropertiesSet() throws Exception {
17+
/*
18+
* This will initialize all the doc handlers using async mode.
19+
* (use method InitHandler.initDocAll() for synced startup)
20+
*/
21+
InitHandler.initDocAllAsync(
22+
docHelper.getDocProcessConfig().getFacade().handlers() );
23+
}
24+
25+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<#import '../flavour-macro.ftl' as fhm>
2+
package <@fhm.toProjectPackage context=context/>;
3+
4+
import org.fugerit.java.doc.freemarker.process.FreemarkerDocProcessConfig;
5+
import org.fugerit.java.doc.freemarker.process.FreemarkerDocProcessConfigFacade;
6+
import org.springframework.stereotype.Component;
7+
8+
@Component
9+
public class DocHelper {
10+
11+
private FreemarkerDocProcessConfig docProcessConfig = FreemarkerDocProcessConfigFacade.loadConfigSafe( "cl://${context.resourcePathFmConfigXml}" );
12+
13+
public FreemarkerDocProcessConfig getDocProcessConfig() { return this.docProcessConfig; }
14+
15+
}

0 commit comments

Comments
 (0)