Set JAVA_OPTS for Windows App Services - microsoft/azure-maven-plugins GitHub Wiki
We removed web.config
since azure-webapp-maven-plugin:1.8.0
, and here is the new workaround to set JAVA_OPTS for Windows App Services
- Create new
startup.cmd
file in project folder as below
"%JAVA_HOME%\bin\java.exe" -noverify -Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% %JAVA_OPTS% -jar "%_WEBAPP_DIR%\app.jar"
- Add
startup.cmd
to<resources>
configuration
<configuration>
<schemaVersion>V2</schemaVersion>
...
<deployment>
<resources>
<resource>
<directory>${project.basedir}/target</directory>
<includes>
<include>*.jar</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>startup.cmd</include>
</includes>
</resource>
</resources>
</deployment>
</configuration>
- Add Java opts to
<appSettings>
<configuration>
<schemaVersion>V2</schemaVersion>
...
<appSettings>
<!--JVM OPTIONS -->
<property>
<name>JAVA_OPTS</name>
<value>-Xms2048m -Xmx2048m</value>
</property>
</appSettings>
...
</configuration>
- Deploy with
azure-webapp:deploy
, and new java opts should works.