Skip to content

Commit d0e4ada

Browse files
committed
build improvements
1 parent 66ae678 commit d0e4ada

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

jooby/src/main/java/org/jooby/Jooby.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757

5858
import java.io.File;
5959
import java.lang.reflect.Type;
60-
import java.net.URL;
6160
import java.nio.charset.Charset;
6261
import java.nio.file.Path;
6362
import java.nio.file.Paths;
@@ -76,6 +75,7 @@
7675
import java.util.Locale;
7776
import java.util.Map;
7877
import java.util.Map.Entry;
78+
import java.util.Objects;
7979
import java.util.Optional;
8080
import java.util.Set;
8181
import java.util.TimeZone;
@@ -2430,7 +2430,8 @@ public Jooby executor(final String name) {
24302430
*/
24312431
private Jooby executor(final String name, final Class<? extends Provider<Executor>> provider) {
24322432
this.executors.add(binder -> {
2433-
binder.bind(Key.get(Executor.class, Names.named(name))).toProvider(provider).in(Singleton.class);
2433+
binder.bind(Key.get(Executor.class, Names.named(name))).toProvider(provider)
2434+
.in(Singleton.class);
24342435
});
24352436
return this;
24362437
}
@@ -3198,7 +3199,6 @@ static String logback(final Config conf) {
31983199
logback = conf.getString("logback.configurationFile");
31993200
} else {
32003201
String env = conf.hasPath("application.env") ? conf.getString("application.env") : null;
3201-
URL cpconf = Jooby.class.getResource("/logback." + env + ".xml");
32023202
ImmutableList.Builder<File> files = ImmutableList.builder();
32033203
File userdir = new File(System.getProperty("user.dir"));
32043204
File confdir = new File(userdir, "conf");
@@ -3213,7 +3213,11 @@ static String logback(final Config conf) {
32133213
.filter(f -> f.exists())
32143214
.map(f -> f.getAbsolutePath())
32153215
.findFirst()
3216-
.orElse((cpconf != null) ? cpconf.toString() : "logback.xml");
3216+
.orElseGet(() -> {
3217+
return Optional.ofNullable(Jooby.class.getResource("/logback." + env + ".xml"))
3218+
.map(Objects::toString)
3219+
.orElse("logback.xml");
3220+
});
32173221
}
32183222
return logback;
32193223
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,7 @@ org.eclipse.jdt.apt.processorOptions/defaultOverwrite=true
27362736
<junit.version>4.12</junit.version>
27372737
<easymock.version>3.2</easymock.version>
27382738
<powermock.version>1.6.4</powermock.version>
2739-
<jacoco.version>0.7.7.201606060606</jacoco.version>
2739+
<jacoco.version>0.7.8</jacoco.version>
27402740

27412741
<!-- Maven properties -->
27422742
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

0 commit comments

Comments
 (0)