serverless-java-container icon indicating copy to clipboard operation
serverless-java-container copied to clipboard

Spring Boot 2 support

Open stephengibson83 opened this issue 8 years ago • 10 comments

  • Framework version: 1.1.4
  • Implementations: Spring Boot

Is there a plan to support Spring Boot 2.0.x? If so, when will it be available?

The current maven archetype and sample are for Spring Boot 1.5.

stephengibson83 avatar Aug 07 '18 19:08 stephengibson83

Hi @stephengibson83, Spring Boot 2 is not supported yet simply because we have not tested with it yet. When I was building the framework Spring Boot 2 was still in preview, there was no official RELEASE version. I do not know whether there are breaking changes. I'll take this as a feature request and work on it for release 1.3.

sapessi avatar Aug 07 '18 20:08 sapessi

@SAPessi Would you like some help? I was looking at the project and there are several changes that I am aware of.

sheltonn avatar Aug 16 '18 19:08 sheltonn

Hey @sheltonn - absolutely, always happy to accept pull requests. If the changes are breaking, we should consider breaking Spring Boot into a separate module. If you can type down a description of the changes here, we can work through a design together. I'm on the road for most of the day today but can take a look tonight.

sapessi avatar Aug 16 '18 19:08 sapessi

Awesome. That is what I was thinking about the project. I may not be able to finish tonight, but I can definitely start.

sheltonn avatar Aug 16 '18 22:08 sheltonn

Oh I didn't mean finish. I just meant write down in this issue a description of what you plan to do and why so we can discuss together with other contributors @sheltonn

sapessi avatar Aug 17 '18 00:08 sapessi

I want to separate this module from the others, preferably in it's own project. I need to research the project code to determine how it really works to see if there are any improvements I can make. I would eat my own dog food by converting this project to be Spring Boot 2. I would rework all of the Junit tests to be more representative of what a Spring/Java would expect to see (Spring and MockMvc).

Also, the project didn't build for me from the parent or from the individual module.

Another option is to rework this project from the parent POM, then rework aws-serverless-java-container-core, etc until everything is updated.

What do you think?

sheltonn avatar Aug 17 '18 14:08 sheltonn

Implementing support for a new framework is relatively straightforward, take a look at #159 for Struts 2. If there are no breaking changes in how a Spring application is initialized in SpringBoot 2 compared to 1.x, then I'd rather keep it in the same spring module - this way customers won't have to learn a whole new thing.

Curious, what do you mean by converting this project to SpringBoot 2? Did you mean adding support for it? The project is intentionally independent from any framework and avoid reflection-based dependency injection to keep the cold start time under control.

What failed in the build? Are you using the master branch?

sapessi avatar Aug 17 '18 15:08 sapessi

Correct. I'm starting to get a grip on the project and how it works. The project should be using straight Java/EE, then adding the plumbing and the dependencies for the specific framework we are implementing.

I'm using master and having trouble just performing mvn clean on the parent module. I think the most value I can provide is to start with the top of the project and tweak the POMs.

UPDATE: I think the problem is caused by having the archetypes directory. They should be directly under the parent. Maybe add Archetype into the names of the modules?

/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/norris.shelton/IdeaProjects/aws/aws-serverless-java-container -Dmaven.home=/Applications/ideaIU-182.4129.26.app/Contents/plugins/maven/lib/maven3 -Dclassworlds.conf=/Applications/ideaIU-182.4129.26.app/Contents/plugins/maven/lib/maven3/bin/m2.conf -Didea.launcher.port=55581 -Didea.launcher.bin.path=/Applications/ideaIU-182.4129.26.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Applications/ideaIU-182.4129.26.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar:/Applications/ideaIU-182.4129.26.app/Contents/lib/idea_rt.jar com.intellij.rt.execution.application.AppMainV2 org.codehaus.classworlds.Launcher -Didea.version=2018.2.2 --errors --update-snapshots clean
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-jersey-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13
[FATAL] Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-spark-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13
[FATAL] Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-spring-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13
[FATAL] Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-springboot-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13
 @ 
[ERROR] The build could not read 4 projects -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-jersey-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13
[FATAL] Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-spark-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13
[FATAL] Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-spring-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13
[FATAL] Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-springboot-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13

	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:422)
	...
[ERROR]   
[ERROR]   The project com.amazonaws.serverless.archetypes:aws-serverless-jersey-archetype:1.2-SNAPSHOT (/Users/norris.shelton/IdeaProjects/aws/aws-serverless-java-container/archetypes/jersey/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-jersey-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT
	at ...
[ERROR]   
[ERROR]   The project com.amazonaws.serverless.archetypes:aws-serverless-spark-archetype:1.2-SNAPSHOT (/Users/norris.shelton/IdeaProjects/aws/aws-serverless-java-container/archetypes/spark/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-spark-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT
	at ...
[ERROR]   
[ERROR]   The project com.amazonaws.serverless.archetypes:aws-serverless-spring-archetype:1.2-SNAPSHOT (/Users/norris.shelton/IdeaProjects/aws/aws-serverless-java-container/archetypes/spring/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-spring-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT
	at ...
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT
	at ...
[ERROR]   
[ERROR]   The project com.amazonaws.serverless.archetypes:aws-serverless-springboot-archetype:1.2-SNAPSHOT (/Users/norris.shelton/IdeaProjects/aws/aws-serverless-java-container/archetypes/springboot/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.amazonaws.serverless.archetypes:aws-serverless-springboot-archetype:1.2-SNAPSHOT: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT
	at ...
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.amazonaws.serverless:aws-serverless-java-container:pom:1.2-SNAPSHOT
	at ...
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Process finished with exit code 1

sheltonn avatar Aug 17 '18 15:08 sheltonn

Mh, this builds fine for me from the main pom. I suspect this is because it expects the 1.2-SNAPSHOT to be already available in your local maven cache as it builds the archetypes. What happens if you run mvn install without clean?

Let's take this to the Gitter room

sapessi avatar Aug 17 '18 16:08 sapessi

Hey @sheltonn, @stephengibson83 - I've added a springboot2 sample in the core branch of this repo. I will work on an archetype too.

sapessi avatar Dec 20 '18 22:12 sapessi