Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix java8 template to support resources #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion template/java8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ WORKDIR /home/app

COPY . /home/app/

RUN gradle build
# The distribution created by `gradle build` is modifying the jars, excluding all resources.
# For that reason it is removed and created with `gradle distZip`
RUN gradle build \
&& rm /home/app/entrypoint/build/distributions/entrypoint* \
&& gradle distZip

FROM openjdk:8u121-jdk-alpine as ship
RUN apk --no-cache add curl \
Expand Down
11 changes: 11 additions & 0 deletions template/java8/entrypoint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ plugins {
// Apply the application plugin to add support for building an application
id 'application'

// Apply the distribution plugin to add resources to entrypoint dist
id 'distribution'

}

// Define the main class for the application
Expand All @@ -29,6 +32,14 @@ dependencies {
compile project(':function')
}

sourceSets {
main {
resources {
srcDirs "src/main/resources"
}
}
}

jar {
manifest {
attributes 'Implementation-Title': 'OpenFaaS Function',
Expand Down