How to deploy jsp in spring boot - java

I want to deploy web application that use jsp files using executable jar(Spring boot)
Project structure:
1)in src\main\resources\META-INF\resources\WEB-INF\jsp folder i put my jsp files
2)app.prop file
spring.mvc.view.prefix : /WEB-INF/jsp/
spring.mvc.view.suffix : .jsp
3)Controller:
#Controller
#RequestMapping("test")
public class TestController {
#RequestMapping(method = RequestMethod.GET)
public String test(){
// System.out.println("Inside controller");
return "test";
}
}
When i build it using mvn package it create jar file, to run jar file I have two options:
1)java -jar MyJar
2)mvn spring-boot:run
When i use mvn spring-boot:run and go to localhost:8080/test my browser show me content of test jsp file
When i use java -jar Myjar.jar and go to the same url i gor an 404 error
There was an unexpected error (type=Not Found, status=404).
/WEB-INF/jsp/test.jsp
I can't always use mvn spring-boot:run because i will deploy jar to remote server. How to solve this problem?
BTW this is my pom
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
</project>

java -jar Myjar.jar command do not deploy your application to embeded tomcat. If you want to use separate application server you can find out your application output in
/target
directory and you need to deploy it.

Related

Java Spring boot executable JAR file not running into another machine

I am trying to package a Java spring boot (Maven) project into JAR file. So that I can take that JAR file into another computer and simply run it. The file is created inside "target" folder. I can run the project fine with following:
java -jar target/project.jar
but whenever I take the Jar file to another place (like, into another PC) and try to run like this:
java -jar project.jar
it's showing White Label Error 404 page at - localhost:8080
How to package the project to run as standalone JAR file without any such errors?
Here's my application.properties file content:
spring.datasource.url=jdbc:mariadb://localhost:3306/sample
spring.datasource.username=root
spring.datasource.password=****
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDB103Dialect
spring.jpa.hibernate.ddl-auto=update
## MULTIPART (MultipartProperties)
# Enable multipart uploads
spring.servlet.multipart.enabled=true
# Threshold after which files are written to disk.
spring.servlet.multipart.file-size-threshold=2KB
# Max file size.
spring.servlet.multipart.max-file-size=200MB
# Max Request Size
spring.servlet.multipart.max-request-size=215MB
## File Storage Properties
# All files uploaded through the REST API will be stored in this directory
file.upload-dir=/Users/noticepush/notices
spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp
And this is my pom.xml content:
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.tech</groupId>
<artifactId>StressDetection</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>StressDetection</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.4.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Any suggestion for me?
Note: Please don't suggest WAR packaging. I am trying to distribute the project as JAR package.
The issue is that when you use java -*.jar to deploy any springboot application , the jsp files will not be present in the embedded tomcat and while trying to serve the request you will get a 404 PAGE NOT FOUND. This is because of the jar packaging ,that the jsp files are not getting copied from the WEB-INF folder. If you keep the jsp files under the META-INF/resources folder while using jar as packaging it should work.
Related Question : Why does Spring boot not support jsp while it can render the page if we add proper jar reference
spring.datasource.url=jdbc:mariadb://localhost:3306/sample Your application has a dependency in some local database.
It can be that in your computer the database exists and is reachable by the application so the application can start and play correctly.
On other computers the database may not exist or may not be reachable from the application so Spring context fails during initialization and therefore the web application is not reachable from you!
If as pointed in comments this is not the issue, then there can be another issue as well.
You can replace the following in your pom.xml
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
with
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
So that the final Jar is a repackaged Fat jar which will contain also all runtime dependencies needed.
I get such error in the past
You are having this error because there is no defaut webPage for spring boot Screenshot with the error
To fix it , you just need to add a simple html file (index.html) in you src/main/resources/statics directory
You might have to configure a view resolver in this case. Typically we place JSP files in the ${project.basedir}/main/webapp/WEB-INF/jsp/. In such a case, you will have to add following 2 configuration parameters in application.properties.
spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp

After deploying war file in Tomcat api not working

I'm trying to deploy app in my local tomcat but have some problems. I use: Tomcat 9, Spring boot, ReactJS and Webpack. When I run embedded Tomcat (in Eclipse) all be ok - API working good, but when I build war file and paste it to my local Tomcat - API not working, all request failed.
How I build war file:
run mvn "clean install";
paste war file to my local Tomcat directory "webapps";
wait for deploying;
go to "http://localhost:8080/web_importer/#/importCandidates". But in this moment when i run in Eclipse my app i use another path: "http://localhost:8080/#/importCandidates" and API use this path to (example) "http://localhost:8080/api/originator", not "http://localhost:8080/web_importer/api/originator".
How I can change this path?
application.properties:
server.port = 8080
management.server.port: 8995
management.server.address: 127.0.0.1
spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=100MB
spring.http.encoding.force=true
OriginatorController.java:
#RequestMapping(value = "/api/originator", method = RequestMethod.GET)
public List<OriginatorModel> retrieveOriginators() {
logger.info("Performing /api/originator GET request");
return originatorService.retrieveOriginators();
}
My pom.xml:
<groupId>com.kddb_web_importer</groupId>
<artifactId>web_importer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>web_importer</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
When you start the application from Eclipse, it uses a standalone server, which is directly accessed via localhost and the URL is http://localhost:8080/api/originator.
When you run your local tomcat instance, http://localhost:8080 is the base tomcat URL. What follows next is the name of your application, in this case web_importer. So the URL becomes http://localhost:8080/web_importer/api/originator and this is why you get 404 Not Found.
It seems that your frontend is calling the API directly at http://localhost:8080/api/originator. You need to change your base API URL in your frontend configuration when you want to use the tomcat-deployed version of your API.

jboss eap 6.4 in maven access failed

I had deploy maven project built in war package to Jboss EAP 6.4 and successfully, WAR package deployed. I had created services and run with spring-boot in local eclipse and I can ran in browser but I have a problem when access that URL based on war package in Jboss eap. I success ran jboss service but cannot run the URL. for example, I have service with method GET with url: localhost:8080/letter-printing-eap-generator/testing cannot run in jboss but ran in local eclipse before deploy. how to fix this problem? any configuration xml in maven project? I just add jboss plugin. thanks. my code:
my pom.xml:
<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>
<groupId>com.prudential.letter.printing</groupId>
<artifactId>letter-printing-eap-generator</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>LetterPrintingEapGenerator</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>1.2.2.RELEASE</spring-cloud.version>
<swagger.version>2.6.1</swagger.version>
<jboss.home>${env.JBOSS_HOME}</jboss.home>
<config.server>http://10.170.49.103/configserver</config.server>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<!-- Spring Boot -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
<version>${spring-cloud.version}</version>
</dependency>
<!-- Swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-data-rest</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- JBOSS maven plugin to simulate deployment to JBOSS -->
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.9.Final</version>
<configuration>
<jbossHome>${jboss.home}</jbossHome>
<serverArgs>
<serverArg>-Dspring.profiles.active=${run.profiles}</serverArg>
<serverArg>-Dspring.cloud.config.uri=${config.server}</serverArg>
</serverArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>
SpringBootRestApiApp.java
#SpringBootApplication(scanBasePackages={"com.prudential.letter.printing"})
#Import({SpringDataRestConfiguration.class})
public class SpringBootRestApiApp {
public static void main(String[] args) {
SpringApplication.run(SpringBootRestApiApp.class, args);
}
}
my controller:
#RestController
#RequestMapping(value="/")
public class TestingController {
#GetMapping("testing")
public String getTestingMethod(){
return "Hello Testing";
}
#GetMapping("data")
public Map<String, Object> getData(){
Map<String, Object> map = new HashMap<String, Object>();
map.put("status", "200");
map.put("message", "ini messagenya");
map.put("content", "mantap");
return map;
}
}
this is my project structure:
application.yml :
server:
port: 8080
contextPath: /letter-printing-eap-generator
In the absence of any specific configuration, JBoss EAP will provide access to your web application at a context with a name that matches the WAR file name.
Therefore, your application should be accessible at:
http://localhost:8080/letter-printing-eap-generator-0.0.1-SNAPSHOT/testing
A common way of changing this for development purposes is to include a finalName element in the pom.xml file:
<build>
<finalName>${project.artifactId}</finalName>
...
</build>
This will generate a WAR file named letter-printing-eap-generator.war and the original URL that you tried should work.
Alternatively, you could add a jboss-web.xml file to your deployment (in the WEB-INF directory) that contains a context-root element:
<jboss-web>
<context-root>letter-printing-eap-generator</context-root>
</jboss-web>
You could also do this using the JBoss CLI or the web console to perform deployment as well.

Make a maven dependency provided based on active spring profile

So I am building a spring boot web application, packaging as a war, and deploying to a tomcat application server.
I have the following dependency in my pom.xml for tomcat:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
The scope of this dependency needs to be provided in order to be able to deploy it to a tomcat instance. However, when I want to run the war via the spring boot CLI or via IntelliJ's default spring boot run configuration, I need to remove the <scope>provided</scope> in order for it to run the embedded tomcat.
My question is, is there some way to make the dependency conditionally provided based on an active spring profile, or some other method?
In your specific case, you can just do :
In the dependencies to run spring-boot with embedded tomcat :
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
And in a profile to deploy under tomcat
<profile>
<id>tomcat</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
After, to build for a specific profile
mvn clean install -Ptomcat
You can't control dependencies via spring profiles. However you can control spring profiles by maven profiles and it can solve your problem.
You can declare several maven profiles in your application and provide different set of dependencies for each of them.
Then you can configure maven profiles to use particular spring profile.
Take a look on maven profiles and an example of such configuration in this thread
This is a solution that will work with both, jar and war packaging:
pom.xml
...
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>...</artifactId>
<groupId>...</groupId>
<version>0-SNAPSHOT</version>
<packaging>${packaging.type}</packaging>
...
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<start-class>...</start-class>
<packaging.type>jar</packaging.type>
...
</properties>
<dependencies>
<dependency>
<!-- Brings in Embedded Tomcat dependencies -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
...
</dependencies>
<profiles>
<profile>
<id>tomcat-war</id>
<properties>
<packaging.type>war</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
...
</profiles>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
...
Build artifact as jar:
mvn clean package
Build artifact as war:
mvn clean package -Ptomcat-war
Main class, that goes in <start-class> in pom.xml:
package ...
public class Application extends SpringBootServletInitializer {
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}

How to deploy spring boot app project to Heroku

I have created a simple server that uses JPA repository and returns a response in Json. It includes methods post and get. It is a spring starter boot app project and everything works on my localhost (I use postman to send and receive json objects). My problem is when I try to deploy to Heroku I run into many problems. I added a jetty-runner dependency and plugin. I also created a procfile as shown below:
web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war
Initially the target folder was empty and foreman start web was saying that it couldn't find my war file, so I added the following line to pom.xml:
<packaging>war</packaging>
But the project created an error, so I disabled maven nature of the project, then configured maven again and then it included pom.properties and pom.xml in the target folder. When I tried to deploy it, it said it was unable to access jetty jar file in target/dependency because there was no folder like that. So I did maven install and it installed the missing folders. Now I get the error that No transaction manager can be found, so I installed a dependency for jetty-plus and Atomikos. But now I still get the error that there is not transaction manager found and there is a java.net.bindexception.
I feel like I am really on the wrong path. I was wondering if anyone can tell me from the beginning on how to deploy a spring starter boot project to heroku. Any help would really be appreciated.
This is my pom.xml file:
<?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>
<groupId>org.test</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Challenge-Server1</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-runner</artifactId>
<version>7.4.5.v20110725</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jta-atomikos</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-runner</artifactId>
<version>7.4.5.v20110725</version>
<destFileName>jetty-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I found out that the deploying a spring boot application is a little different then deploying spring boot mvc project. Basically you don't need a jetty-runner dependency or plugin, you just do the following steps:
Configure a mvn project
mvn clean and install
Declare Procfile as: web: java $JAVA_OPTS -Dserver.port=$PORT -jar target/*.jar
All found from this site:
http://web.archive.org/web/20171018145733/http://nicholaspaulsmith.com/spring-boot-on-heroku/
I outlined some details in my blog
https://exampledriven.wordpress.com/2016/11/04/spring-boot-heroku-example/
The main point is to use the heroku maven plugin like this
heroku plugins:install heroku-cli-deploy
mvn clean install
# Creates an app with the specified name, without setting up a git remote
heroku create <APP-NAME> --no-remote
#deploys the jar file
heroku deploy:jar target/demo-0.0.1-SNAPSHOT.jar --app <APP-NAME>
but there are more details like how to set up a CI/CD pipeline

Categories

Resources