Skip to content

Commit 536b12e

Browse files
committed
Upgrade to coffig
1 parent 216d203 commit 536b12e

29 files changed

+305
-240
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Version 3.0.0 (2016-12-??)
2+
3+
* [brk] Moved to SeedStack 16.11 new configuration system.
4+
* [brk] JPA unit property used to specify an explicit unit name has been renamed from `org.seedstack.jpa.unit-name` to `seedstack.jpaUnitName`.
5+
16
# Version 2.2.1 (2016-04-26)
27

38
* [chg] Update for SeedStack 16.4.

batch/pom.xml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>org.seedstack.addons.spring</groupId>
1616
<artifactId>spring-bridge</artifactId>
17-
<version>2.2.1-SNAPSHOT</version>
17+
<version>3.0.0-SNAPSHOT</version>
1818
</parent>
1919

2020
<artifactId>spring-bridge-batch</artifactId>
@@ -71,7 +71,7 @@
7171
<artifactId>business-core</artifactId>
7272
<version>${business.version}</version>
7373
<scope>test</scope>
74-
</dependency>
74+
</dependency>
7575
<dependency>
7676
<groupId>org.springframework.batch</groupId>
7777
<artifactId>spring-batch-infrastructure</artifactId>
@@ -84,24 +84,24 @@
8484
<version>${spring.version}</version>
8585
<scope>test</scope>
8686
</dependency>
87-
<dependency>
88-
<groupId>org.springframework</groupId>
89-
<artifactId>spring-orm</artifactId>
90-
<version>${spring.version}</version>
87+
<dependency>
88+
<groupId>org.springframework</groupId>
89+
<artifactId>spring-orm</artifactId>
90+
<version>${spring.version}</version>
91+
<scope>test</scope>
92+
</dependency>
93+
<dependency>
94+
<groupId>org.springframework.data</groupId>
95+
<artifactId>spring-data-jpa</artifactId>
96+
<version>1.9.4.RELEASE</version>
9197
<scope>test</scope>
92-
</dependency>
93-
<dependency>
94-
<groupId>org.springframework.data</groupId>
95-
<artifactId>spring-data-jpa</artifactId>
96-
<version>1.9.4.RELEASE</version>
97-
<scope>test</scope>
98-
</dependency>
99-
<dependency>
100-
<groupId>org.hibernate</groupId>
101-
<artifactId>hibernate-entitymanager</artifactId>
102-
<version>4.3.4.Final</version>
103-
<scope>test</scope>
104-
</dependency>
98+
</dependency>
99+
<dependency>
100+
<groupId>org.hibernate</groupId>
101+
<artifactId>hibernate-entitymanager</artifactId>
102+
<version>4.3.4.Final</version>
103+
<scope>test</scope>
104+
</dependency>
105105
<dependency>
106106
<groupId>org.hsqldb</groupId>
107107
<artifactId>hsqldb</artifactId>
@@ -115,10 +115,16 @@
115115
<scope>test</scope>
116116
</dependency>
117117
<dependency>
118-
<groupId>org.seedstack.addons.jpa</groupId>
119-
<artifactId>jpa</artifactId>
120-
<version>${jpa-addon.version}</version>
121-
<scope>test</scope>
118+
<groupId>org.glassfish</groupId>
119+
<artifactId>javax.el</artifactId>
120+
<version>3.0.0</version>
121+
<scope>test</scope>
122+
</dependency>
123+
<dependency>
124+
<groupId>org.seedstack.addons.jpa</groupId>
125+
<artifactId>jpa</artifactId>
126+
<version>${jpa-addon.version}</version>
127+
<scope>test</scope>
122128
</dependency>
123129
</dependencies>
124130
</project>

batch/src/it/java/org/seedstack/spring/batch/fixtures/FlatFileBatchDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static void main(String[] argv) throws Exception {
2323

2424
Job job = applicationContext.getBean(Job.class);
2525

26-
Map<String, JobParameter> jobParametersMap = new HashMap<String, JobParameter>();
26+
Map<String, JobParameter> jobParametersMap = new HashMap<>();
2727

2828
jobParametersMap.put("file", new JobParameter(argv[1]));
2929

batch/src/it/resources/META-INF/configuration/springTest.props renamed to batch/src/it/resources/application.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#
2-
# Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org>
3-
#
4-
# This Source Code Form is subject to the terms of the Mozilla Public
5-
# License, v. 2.0. If a copy of the MPL was not distributed with this
6-
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
7-
#
8-
9-
[org.seedstack.spring]
10-
manage-transactions = true
1+
#
2+
# Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org>
3+
#
4+
# This Source Code Form is subject to the terms of the Mozilla Public
5+
# License, v. 2.0. If a copy of the MPL was not distributed with this
6+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+
#
8+
9+
spring:
10+
manageJpa: true

batch/src/main/java/org/seedstack/spring/batch/internal/SpringBatchCommandLineHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public Integer call() throws JobExecutionException {
8383

8484
private JobParameters getJobParameters() {
8585
if (optionJobParameters != null && !optionJobParameters.isEmpty()) {
86-
Map<String, JobParameter> mapJobParameter = new HashMap<String, JobParameter>();
86+
Map<String, JobParameter> mapJobParameter = new HashMap<>();
8787

8888
for (Map.Entry<String, String> stringJobParameterEntry : optionJobParameters.entrySet()) {
8989
mapJobParameter.put(stringJobParameterEntry.getKey(), new JobParameter(stringJobParameterEntry.getValue()));

core/pom.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<parent>
1414
<groupId>org.seedstack.addons.spring</groupId>
1515
<artifactId>spring-bridge</artifactId>
16-
<version>2.2.1-SNAPSHOT</version>
16+
<version>3.0.0-SNAPSHOT</version>
1717
</parent>
1818

1919
<artifactId>spring-bridge-core</artifactId>
@@ -46,11 +46,6 @@
4646
<artifactId>seed-core</artifactId>
4747
<version>${seed.version}</version>
4848
</dependency>
49-
<dependency>
50-
<groupId>org.seedstack.seed</groupId>
51-
<artifactId>seed-transaction</artifactId>
52-
<version>${seed.version}</version>
53-
</dependency>
5449
<dependency>
5550
<groupId>org.seedstack.seed</groupId>
5651
<artifactId>seed-testing</artifactId>
@@ -104,7 +99,13 @@
10499
<artifactId>hibernate-entitymanager</artifactId>
105100
<version>4.3.11.Final</version>
106101
<scope>test</scope>
107-
</dependency>
102+
</dependency>
103+
<dependency>
104+
<groupId>org.glassfish</groupId>
105+
<artifactId>javax.el</artifactId>
106+
<version>3.0.0</version>
107+
<scope>test</scope>
108+
</dependency>
108109
<dependency>
109110
<groupId>ch.qos.logback</groupId>
110111
<artifactId>logback-classic</artifactId>

core/src/it/java/org/seedstack/spring/SeedFactoryBeanIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
import java.lang.reflect.Proxy;
2828

2929
public class SeedFactoryBeanIT {
30-
static Kernel kernel;
31-
ApplicationContext context;
32-
Holder holder;
30+
private static Kernel kernel;
31+
private ApplicationContext context;
32+
private Holder holder;
3333

3434
static class Holder {
3535
@Inject

core/src/it/resources/META-INF/spring/SeedFactoryBeanIT-context.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121

2222
<bean id="service4" class="org.seedstack.spring.fixtures.DummyService">
2323
<property name="configurationValue">
24-
<seed:configuration key="org.seedstack.spring.test-value"/>
24+
<seed:configuration key="someProperties.testValue"/>
2525
</property>
2626
<property name="otherConfigurationValue">
27-
<seed:configuration key="org.seedstack.spring.test-other-value"/>
27+
<seed:configuration key="someProperties.testOtherValue"/>
2828
</property>
2929
<property name="defaultConfigurationValue">
30-
<seed:configuration key="org.seedstack.spring.test-default-value" default="1.5"/>
30+
<seed:configuration key="someProperties.testDefaultValue" default="1.5"/>
3131
</property>
3232
</bean>
3333
</beans>

core/src/it/resources/META-INF/configuration/org.seedstack.spring.props renamed to core/src/it/resources/application.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
77
#
88

9-
[org.seedstack.spring]
10-
manage-transactions = true
11-
test-value = Hello
12-
test-other-value = 5
13-
14-
[org.seedstack.spring.fixtures.UserServiceImpl]
15-
jpa-unit = default2
9+
spring:
10+
manageJpa: true
11+
someProperties:
12+
testValue: Hello
13+
testOtherValue: 5
14+
classes:
15+
org:
16+
seedstack:
17+
spring:
18+
fixtures:
19+
UserServiceImpl:
20+
jpaUnit: default2
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org>
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*/
8+
package org.seedstack.spring;
9+
10+
import org.seedstack.coffig.Config;
11+
12+
import java.util.ArrayList;
13+
import java.util.Collections;
14+
import java.util.List;
15+
16+
@Config("spring")
17+
public class SpringConfig {
18+
private boolean autodetect = true;
19+
private boolean manageJpa = true;
20+
private List<String> contexts = new ArrayList<>();
21+
22+
public boolean isAutodetect() {
23+
return autodetect;
24+
}
25+
26+
public SpringConfig setAutodetect(boolean autodetect) {
27+
this.autodetect = autodetect;
28+
return this;
29+
}
30+
31+
public boolean isManageJpa() {
32+
return manageJpa;
33+
}
34+
35+
public SpringConfig setManageJpa(boolean manageJpa) {
36+
this.manageJpa = manageJpa;
37+
return this;
38+
}
39+
40+
public List<String> getContexts() {
41+
return Collections.unmodifiableList(contexts);
42+
}
43+
44+
public SpringConfig addContext(String context) {
45+
this.contexts.add(context);
46+
return this;
47+
}
48+
}

0 commit comments

Comments
 (0)