-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repackage application as a runnable WAR
The previous build created a fat JAR that could only be run from the command line. This commit modifies the Gradle configuration to build a WAR that can be run inside an application server. Command-line behaviour is preserved by the Spring Boot Gradle plugin which adds provided dependencies to the WAR. Resolves issue #31.
- Loading branch information
Showing
5 changed files
with
72 additions
and
40 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ MAINTAINER Emerson Farrugia <[email protected]> | |
ENV SERVER_PREFIX /opt/omh/shimmer | ||
|
||
RUN mkdir -p $SERVER_PREFIX | ||
ADD shimmer.jar $SERVER_PREFIX/ | ||
ADD shimmer.war $SERVER_PREFIX/ | ||
EXPOSE 8083 | ||
|
||
CMD /usr/bin/java -jar $SERVER_PREFIX/shimmer.jar --spring.config.location=file:$SERVER_PREFIX/ | ||
CMD /usr/bin/java -jar $SERVER_PREFIX/shimmer.war --spring.config.location=file:$SERVER_PREFIX/ |
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
24 changes: 24 additions & 0 deletions
24
...ver/src/main/java/org/openmhealth/shimmer/common/configuration/SecurityConfiguration.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,24 @@ | ||
package org.openmhealth.shimmer.common.configuration; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
|
||
|
||
/** | ||
* TODO this is just a refactoring of existing code, needs to be revised | ||
* | ||
* @author Emerson Farrugia | ||
*/ | ||
@Configuration | ||
public class SecurityConfiguration extends WebSecurityConfigurerAdapter { | ||
|
||
@Override | ||
protected void configure(HttpSecurity http) throws Exception { | ||
|
||
/** | ||
* Allow full anonymous authentication. | ||
*/ | ||
http.csrf().disable().authorizeRequests().anyRequest().permitAll(); | ||
} | ||
} |
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