-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enables /mvn clean package liberty:run -Pliberty
- Loading branch information
Showing
13 changed files
with
383 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,9 @@ | |
|
||
import javax.annotation.PostConstruct; | ||
import javax.enterprise.context.ApplicationScoped; | ||
import java.util.Objects; | ||
import java.util.Scanner; | ||
|
||
|
||
/** | ||
* @author Michal Karm Babacek <[email protected]> | ||
*/ | ||
|
@@ -38,8 +38,8 @@ public class Version { | |
|
||
@PostConstruct | ||
public void init() { | ||
try (Scanner s = new Scanner(FilesLocator.class.getClassLoader() | ||
.getResourceAsStream("/version.txt")).useDelimiter("\\A")) { | ||
try (Scanner s = new Scanner(Objects.requireNonNull( | ||
FilesLocator.class.getClassLoader().getResourceAsStream("/version.txt"))).useDelimiter("\\A")) { | ||
git = s.hasNext() ? s.next() : ""; | ||
} catch (Exception e) { | ||
LOG.error(e.getMessage()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/java/org/eclipse/microprofile/starter/log/AppContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.eclipse.microprofile.starter.log; | ||
|
||
import javax.inject.Qualifier; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Qualifier | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) | ||
public @interface AppContext { | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/org/eclipse/microprofile/starter/log/ManagedExecutorProducer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.eclipse.microprofile.starter.log; | ||
|
||
import org.eclipse.microprofile.context.ManagedExecutor; | ||
|
||
import javax.enterprise.context.ApplicationScoped; | ||
import javax.enterprise.inject.Disposes; | ||
import javax.enterprise.inject.Produces; | ||
|
||
@ApplicationScoped | ||
public class ManagedExecutorProducer { | ||
|
||
@Produces | ||
@AppContext | ||
ManagedExecutor createExecutor() { | ||
return ManagedExecutor.builder().build(); | ||
} | ||
|
||
void disposeExecutor(@Disposes @AppContext ManagedExecutor exec) { | ||
exec.shutdownNow(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server description="${project.name}"> | ||
<featureManager> | ||
<feature>microProfile-4.1</feature> | ||
<feature>webprofile-8.0</feature> | ||
<feature>mpContextPropagation-1.2</feature> | ||
</featureManager> | ||
<httpEndpoint id="defaultHttpEndpoint" | ||
httpPort="9080" | ||
httpsPort="9443"/> | ||
<webApplication location="${project.name}.war" contextRoot="${app.context.root}"> | ||
<classloader apiTypeVisibility="+third-party" /> | ||
</webApplication> | ||
</server> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters