-
Notifications
You must be signed in to change notification settings - Fork 52
Add flex JAR template #2545
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
Open
chanseokoh
wants to merge
16
commits into
master
Choose a base branch
from
chanseok-wip
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add flex JAR template #2545
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ad634d5
Add Flex JAR template
chanseokoh d365468
Fix messages.properties key
chanseokoh ce0d050
Merge branch 'master' into chanseok-wip
chanseokoh b1357de
Add one-jar Maven build plugin
chanseokoh abcf8e8
Rename main class
chanseokoh f400972
Add tests
chanseokoh ea92b1b
Specify Main-Class in pom.xml
chanseokoh 979dd30
Pick up correct fat jar to deploy
chanseokoh 61f6fab
Serve HTTP req at root context
chanseokoh a73754a
Add more tests
chanseokoh 77e68a8
Revert accidental change
chanseokoh 8b565d4
Simpler pom.xml configuration
chanseokoh 51c8170
Add Spring Boot sample
chanseokoh 415bc24
Add tests
chanseokoh 58c0633
Code style
chanseokoh 521bccb
Remove showDeprecation from pom.xml
chanseokoh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
20 changes: 20 additions & 0 deletions
20
...com.google.cloud.tools.eclipse.util/templates/appengine/HelloAppEngineSpringBoot.java.ftl
This file contains hidden or 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,20 @@ | ||
| <#if package != "">package ${package}; | ||
|
|
||
| </#if>import org.springframework.boot.SpringApplication; | ||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @SpringBootApplication | ||
| @RestController | ||
| public class HelloAppEngineSpringBoot { | ||
|
|
||
| @RequestMapping("/") | ||
| public String home() { | ||
| return "Hello App Engine!"; | ||
| } | ||
|
|
||
| public static void main(String[] args) { | ||
| SpringApplication.run(HelloAppEngineSpringBoot.class, args); | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
...d.tools.eclipse.util/templates/appengine/HelloAppEngineSpringBootIntegrationTest.java.ftl
This file contains hidden or 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,29 @@ | ||
| <#if package != "">package ${package}; | ||
|
|
||
| </#if>import static org.junit.Assert.assertTrue; | ||
| import org.junit.Test; | ||
| import org.junit.runner.RunWith; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.boot.test.context.SpringBootTest; | ||
| import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; | ||
| import org.springframework.boot.test.web.client.TestRestTemplate; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.test.context.junit4.SpringRunner; | ||
|
|
||
| @RunWith(SpringRunner.class) | ||
| @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) | ||
| public class HelloAppEngineSpringBootIntegrationTest { | ||
|
|
||
| @Autowired | ||
| private TestRestTemplate template; | ||
|
|
||
| @Test | ||
| public void contextLoads() throws Exception { | ||
| } | ||
|
|
||
| @Test | ||
| public void testRequest() throws Exception { | ||
| ResponseEntity<String> responseEntity = template.getForEntity("/", String.class); | ||
| assertTrue(responseEntity.toString().contains("Hello App Engine!")); | ||
| } | ||
| } |
73 changes: 73 additions & 0 deletions
73
plugins/com.google.cloud.tools.eclipse.util/templates/appengine/pom.xml.flex.spring.boot.ftl
This file contains hidden or 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,73 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
|
||
| <modelVersion>4.0.0</modelVersion> | ||
| <packaging>jar</packaging> | ||
| <version>${projectVersion}</version> | ||
|
|
||
| <groupId>${projectGroupId}</groupId> | ||
| <artifactId>${projectArtifactId}</artifactId> | ||
|
|
||
| <properties> | ||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| <maven.compiler.source>1.8</maven.compiler.source> | ||
| <maven.compiler.target>1.8</maven.compiler.target> | ||
| <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation> | ||
| </properties> | ||
|
|
||
| <prerequisites> | ||
| <maven>3.3.9</maven> | ||
| </prerequisites> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-web</artifactId> | ||
| <version>1.5.8.RELEASE</version> | ||
| </dependency> | ||
|
|
||
| <!-- Test Dependencies --> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-test</artifactId> | ||
| <version>1.5.8.RELEASE</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.codehaus.mojo</groupId> | ||
| <artifactId>versions-maven-plugin</artifactId> | ||
| <version>2.4</version> | ||
| <executions> | ||
| <execution> | ||
| <phase>compile</phase> | ||
| <goals> | ||
| <goal>display-dependency-updates</goal> | ||
| <goal>display-plugin-updates</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
|
|
||
| <plugin> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-maven-plugin</artifactId> | ||
| <version>1.5.8.RELEASE</version> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>repackage</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
|
|
||
| </build> | ||
| </project> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to show deprecation?
In general I prefer to keep samples minimal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original and current standard env
pom.xmlhad this, and this is currently in everypom.xmlwe generate. I'll remove all of them here. Just let me know if you change your mind.