From 56403fac16fee4fdc431242cf1b1bbc8b7c483c7 Mon Sep 17 00:00:00 2001 From: Will Price Date: Fri, 25 Aug 2017 10:34:07 +0100 Subject: [PATCH] Update java-lang boilerplate --- langs/java.go | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/langs/java.go b/langs/java.go index fe1aed4..6334057 100644 --- a/langs/java.go +++ b/langs/java.go @@ -21,7 +21,7 @@ func (lh *JavaLangHelper) BuildFromImage() string { return "maven:3.5-jdk-8-alpi // RunFromImage returns the Docker image used to run the Java function. func (lh *JavaLangHelper) RunFromImage() string { - return "registry.oracledx.com/skeppare/jfaas-runtime:latest" + return "fnproject/fn-java-fdk:latest" } // HasPreBuild returns whether the Java runtime has boilerplate that can be generated. @@ -54,17 +54,17 @@ func (lh *JavaLangHelper) GenerateBoilerplate() error { return ioutil.WriteFile(fullFilePath, []byte(content), os.FileMode(0644)) } - err = mkDirAndWriteFile("src/main/java/com/example/faas", "HelloFunction.java", helloJavaSrcBoilerplate) + err = mkDirAndWriteFile("src/main/java/com/example/fn", "HelloFunction.java", helloJavaSrcBoilerplate) if err != nil { return err } - return mkDirAndWriteFile("src/test/java/com/example/faas", "HelloFunctionTest.java", helloJavaTestBoilerplate) + return mkDirAndWriteFile("src/test/java/com/example/fn", "HelloFunctionTest.java", helloJavaTestBoilerplate) } // Entrypoint returns the Java runtime Docker entrypoint that will be executed when the function is executed. func (lh *JavaLangHelper) Cmd() string { - return "com.example.faas.HelloFunction::handleRequest" + return "com.example.fn.HelloFunction::handleRequest" } // DockerfileCopyCmds returns the Docker COPY command to copy the compiled Java function jar and dependencies. @@ -124,8 +124,8 @@ func mavenOpts() string { return opts.String() } -/* TODO temporarily generate maven project boilerplate from hardcoded values. - Will eventually move to using a maven archetype. +/* TODO temporarily generate maven project boilerplate from hardcoded values. +Will eventually move to using a maven archetype. */ const ( @@ -137,30 +137,47 @@ const ( UTF-8 - com.example.faas + com.example.fn hello 1.0.0 - nexus-box - http://10.167.103.241:8081/repository/maven-snapshots/ + fn-release-repo + https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/opc0002/mvnrepo/releases + + true + + + false + + + + fn-snapshot-repo + https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/opc0002/mvnrepo/snapshots + + false + + + true + always + - com.oracle.faas + com.fnproject.fn api 1.0.0-SNAPSHOT - com.oracle.faas + com.fnproject.fn testing 1.0.0-SNAPSHOT test - + junit junit 4.12 @@ -184,7 +201,7 @@ const ( ` - helloJavaSrcBoilerplate = `package com.example.faas; + helloJavaSrcBoilerplate = `package com.example.fn; public class HelloFunction { @@ -196,9 +213,9 @@ public class HelloFunction { }` - helloJavaTestBoilerplate = `package com.example.faas; + helloJavaTestBoilerplate = `package com.example.fn; -import com.oracle.faas.testing.*; +import com.fnproject.fn.testing.*; import org.junit.*; import static org.junit.Assert.*;