Skip to content

Commit

Permalink
Fixed external jar startup
Browse files Browse the repository at this point in the history
  • Loading branch information
oskopek committed Mar 21, 2017
1 parent d225c62 commit 14658cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ private void initialize() {
private void populatePlanners() {
Reflections reflections = new Reflections(new ConfigurationBuilder()
.setUrls(ClasspathHelper.forClass(Planner.class))
.setScanners(new SubTypesScanner())
.filterInputsBy(s -> s.matches("com\\.oskopek\\.transporteditor.*\\.class$"))
.setScanners(new SubTypesScanner(false))
.filterInputsBy(s -> s != null && s.startsWith("com.oskopek.transporteditor.") && s.endsWith(".class"))
);
Stream.ofAll(reflections.getSubTypesOf(Planner.class))
.filter(type -> !Modifier.isAbstract(type.getModifiers()))
.map(type -> Tuple.of(type, Try.of(() -> type.newInstance()).toJavaOptional()))
.map(type -> Tuple.of(type, Try.of(type::newInstance).toJavaOptional()))
.map(tuple -> tuple.map((type, instance) -> Tuple.of(type.getSimpleName(), instance)))
.filter(tuple -> tuple._2.isPresent())
.forEach(tuple -> addPlanner(tuple._1, tuple._2.get()));
Expand Down
3 changes: 3 additions & 0 deletions transporteditor-editor/src/main/resources/META-INF/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
<exclude name="ch.**"/>
<exclude name="com.github.**"/>
<exclude name="com.google.**"/>
<exclude name="com.fasterxml.**"/>
<exclude name="com.keypoint.**"/>
<exclude name="com.lowagie.**"/>
<exclude name="com.sun.**"/>
<exclude name="com.thoughtworks.**"/>
<exclude name="freemarker.**"/>
<exclude name="javaslang.**"/>
<exclude name="javassist.**"/>
<exclude name="javax.**"/>
<exclude name="license.**"/>
<exclude name="org.**"/>
Expand Down

0 comments on commit 14658cf

Please sign in to comment.