I am trying to configure the Procfile file for Heroku platform to run the application locally. I am trying to run a Tomcat-based Java Web Application.
In the tutorial they say:
To build your app locally do this:
Use the Git Bash application to open a command shell on Windows.
$ mvn clean install
$ heroku local web
I am in the project directory and after mvn clean install
I receive
BUILD SUCCESS
The problem is when I run: heroku local web
I receive [WARN] No ENV file found
web.1 | Error: Could not find or load main class $JAVA_OPTS
My Procfile has 1 line:
web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/*.war
I am using Windows. I saw a post on stack and they were saying that the code on Windows in the Procfile is different. It should look something like this(my creation):
web: java %JAVA_OPTS% -jar target\dependency\webapp-runner.jar --port %PORT% target*.war
I have to create a folder called "dependency" in the target folder? because I don't have webbapp-runner.jar in my project and I don't understand what should I do.
Here is 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.rares</groupId>
<artifactId>first-web-application</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>com.github.jsimone</groupId>
<artifactId>webapp-runner</artifactId>
<version>8.5.11.2</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<verbose>true</verbose>
<source>1.8</source>
<target>1.8</target>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/</path>
<contextReloadable>true</contextReloadable>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Should I add the webapp-runner as a plugin?