1
votes

I want to use spring to develop java applications. For the time being I don't develop microservices and I don't deploy to clouds. I need war-files running on a Java EE 6 Web Profile Server. I hope Spring Boot is useful for such a scenario.

I imported the project http://spring.io/guides/gs/spring-boot/ into Eclipse via File -> Import -> Spring -> Spring Getting Started Content -> Spring Boot

Now I unfortunately don't exactly know what to do in order to get this project running on my Java EE 6 Web Profile Server inside Eclipse.

First in the pom.xml I added

<executions>    
  <execution>       
    <goals>         
      <goal>repackage</goal>
    </goals>    
</execution>

to the spring-boot-maven-plugin and changed the packaging to war.

Right click on the project -> Run as -> Run on server shows only "Pivotal Cloud Foundry" and not the Java EE 6 Web Profile Server. Does it have to do with the project facets where only "Cloud Foundry Standalone Application" is flagged?

I am not quite familiar with these things because in the past I simply imported appropriate maven projects and could just build them and deploy them to a server.

The server is a Java EE 6 Web Profile application runtime container (provides implementation for Servlet 3.0 among others) and in Eclipse I added it in the preferences to Server -> Runtime Environments.

1
A Spring Boot application can be deployed on regular application servers. However, your current problem has nothing to do with Spring Boot, but with your IDE. Which type of server do you use and have you configured it in Eclipse?dunni

1 Answers

0
votes

The documentation explains you how to use war packaging and there is even a getting started guide about that. If you follow that you should be fine.

Note that you don't need a JavaEE web profile server to deploy a Spring Boot application: any servlet container using Servlet 3 or later will do.