File tree Expand file tree Collapse file tree 13 files changed +989
-848
lines changed
core/src/main/java/org/sterl/spring/persistent_tasks Expand file tree Collapse file tree 13 files changed +989
-848
lines changed Original file line number Diff line number Diff line change 77import java .lang .annotation .Target ;
88
99import org .springframework .context .annotation .Import ;
10+ import org .sterl .spring .persistent_tasks .config .SpringPersistentTasksConfig ;
1011
12+ /**
13+ * Enables the spring persistent task services.
14+ *
15+ * <pre>
16+ * @SpringBootApplication
17+ * @EnableSpringPersistentTasks
18+ * public class MyApp {
19+ * }
20+ * </pre>
21+ * <p>Include corresponding annotation if you use:</p>
22+ * <ul>
23+ * <li>@EntityScan -> {@link EnableSpringPersistentTasksEntityScan}</li>
24+ * <li>@EnableJpaRepositories -> {@link EnableSpringPersistentTasksJpaRepositories}</li>
25+ * <li>@EnableEnversRepositories -> {@link EnableSpringPersistentTasksJpaRepositories}</li>
26+ * </ul>
27+ *
28+ * They break the spring auto configuration.
29+ */
1130@ Target (ElementType .TYPE )
1231@ Retention (RetentionPolicy .RUNTIME )
1332@ Documented
Original file line number Diff line number Diff line change 1+ package org .sterl .spring .persistent_tasks ;
2+
3+ import java .lang .annotation .Documented ;
4+ import java .lang .annotation .ElementType ;
5+ import java .lang .annotation .Retention ;
6+ import java .lang .annotation .RetentionPolicy ;
7+ import java .lang .annotation .Target ;
8+
9+ import org .springframework .context .annotation .Import ;
10+ import org .sterl .spring .persistent_tasks .config .EnableSpringPersistentTasksEntityScanConfig ;
11+
12+ /**
13+ * Annotation to include spring persistent task entities if <code>@EntityScan</code> annotation is used.
14+ *
15+ * <pre>
16+ * @SpringBootApplication
17+ * @EntityScan
18+ * @EnableSpringPersistentTasksEntityScan
19+ * @EnableSpringPersistentTasks
20+ * public class MyApp {
21+ * }
22+ * </pre>
23+ */
24+ @ Target (ElementType .TYPE )
25+ @ Retention (RetentionPolicy .RUNTIME )
26+ @ Documented
27+ @ Import (EnableSpringPersistentTasksEntityScanConfig .class )
28+ public @interface EnableSpringPersistentTasksEntityScan {
29+
30+ }
Original file line number Diff line number Diff line change 1+ package org .sterl .spring .persistent_tasks ;
2+
3+ import java .lang .annotation .Documented ;
4+ import java .lang .annotation .ElementType ;
5+ import java .lang .annotation .Retention ;
6+ import java .lang .annotation .RetentionPolicy ;
7+ import java .lang .annotation .Target ;
8+
9+ import org .springframework .context .annotation .Import ;
10+ import org .sterl .spring .persistent_tasks .config .EnableSpringPersistentTasksJpaRepositoriesConfig ;
11+
12+ /**
13+ * Annotation to include spring persistent task repositories if <code>@EnableJpaRepositories</code> annotation is used.
14+ *
15+ * <pre>
16+ * @SpringBootApplication
17+ * @EnableJpaRepositories
18+ * @EnableSpringPersistentTasksJpaRepositories
19+ * @EnableSpringPersistentTasks
20+ * public class MyApp {
21+ * }
22+ * </pre>
23+ */
24+ @ Target (ElementType .TYPE )
25+ @ Retention (RetentionPolicy .RUNTIME )
26+ @ Documented
27+ @ Import (EnableSpringPersistentTasksJpaRepositoriesConfig .class )
28+ public @interface EnableSpringPersistentTasksJpaRepositories {
29+
30+ }
Original file line number Diff line number Diff line change 1+ package org .sterl .spring .persistent_tasks .config ;
2+
3+ import org .springframework .beans .factory .config .BeanDefinition ;
4+ import org .springframework .boot .autoconfigure .domain .EntityScan ;
5+ import org .springframework .context .annotation .Role ;
6+ import org .sterl .spring .persistent_tasks .EnableSpringPersistentTasksEntityScan ;
7+
8+ @ EntityScan (basePackageClasses = EnableSpringPersistentTasksEntityScan .class )
9+ @ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
10+ public class EnableSpringPersistentTasksEntityScanConfig {
11+
12+ }
Original file line number Diff line number Diff line change 1+ package org .sterl .spring .persistent_tasks .config ;
2+
3+ import org .springframework .beans .factory .config .BeanDefinition ;
4+ import org .springframework .context .annotation .Role ;
5+ import org .springframework .data .jpa .repository .config .EnableJpaRepositories ;
6+ import org .sterl .spring .persistent_tasks .EnableSpringPersistentTasksJpaRepositories ;
7+
8+ @ EnableJpaRepositories (basePackageClasses = EnableSpringPersistentTasksJpaRepositories .class )
9+ @ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
10+ public class EnableSpringPersistentTasksJpaRepositoriesConfig {
11+
12+ }
Original file line number Diff line number Diff line change 1- package org .sterl .spring .persistent_tasks ;
1+ package org .sterl .spring .persistent_tasks . config ;
22
3+ import org .springframework .beans .factory .config .BeanDefinition ;
34import org .springframework .boot .autoconfigure .AutoConfigurationPackage ;
45import org .springframework .context .annotation .ComponentScan ;
5- import org .springframework .context .annotation .Configuration ;
6+ import org .springframework .context .annotation .Role ;
67import org .springframework .scheduling .annotation .EnableAsync ;
78import org .springframework .scheduling .annotation .EnableScheduling ;
9+ import org .sterl .spring .persistent_tasks .EnableSpringPersistentTasks ;
810
9- @ Configuration
1011@ EnableScheduling
1112@ EnableAsync
1213@ AutoConfigurationPackage (basePackageClasses = EnableSpringPersistentTasks .class )
1314@ ComponentScan (basePackageClasses = EnableSpringPersistentTasks .class )
15+ @ Role (BeanDefinition .ROLE_INFRASTRUCTURE )
1416public class SpringPersistentTasksConfig {
1517
1618}
Original file line number Diff line number Diff line change 2626public class ExampleApplication {
2727```
2828
29+ Include corresponding annotation if you use:
30+
31+ - `@EntityScan ` - > ` @EnableSpringPersistentTasksEntityScan `
32+ - `@EnableJpaRepositories ` - > `@EnableSpringPersistentTasksJpaRepositories `
33+ - `@EnableEnversRepositories ` - > ` @EnableSpringPersistentTasksJpaRepositories `
34+
35+ They break the spring auto configuration.
36+
2937# DB using liquibase
3038
3139Dependency needed to setup the DB using liquibase
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >org.springframework.boot</groupId >
88 <artifactId >spring-boot-starter-parent</artifactId >
9- <version >3.3.12 </version >
9+ <version >3.4.10 </version >
1010 <relativePath /> <!-- lookup parent from repository -->
1111 </parent >
1212
1717 <!--
1818 <spt.version>2.1.2</spt.version>
1919 -->
20- <spt .version>2.2.1 </spt .version>
20+ <spt .version>2.2.3-SNAPSHOT </spt .version>
2121 </properties >
2222
2323 <dependencies >
4848 <groupId >org.springframework.boot</groupId >
4949 <artifactId >spring-boot-starter-web</artifactId >
5050 </dependency >
51+
52+ <dependency >
53+ <groupId >org.springframework.data</groupId >
54+ <artifactId >spring-data-envers</artifactId >
55+ </dependency >
56+
5157
5258 <dependency >
5359 <groupId >org.springframework.boot</groupId >
Original file line number Diff line number Diff line change 3636
3737 <properties >
3838 <java .version>21</java .version>
39- <spring-boot .version>3.4.7 </spring-boot .version>
39+ <spring-boot .version>3.4.10 </spring-boot .version>
4040 <maven .compiler.source>${java.version} </maven .compiler.source>
4141 <maven .compiler.target>${java.version} </maven .compiler.target>
4242 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
You can’t perform that action at this time.
0 commit comments