Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wildfly in Eclipse is adding the Maven SNAPSHOT to the web context

I'm having a new problem when we moved to a Wildfly 8.x server in eclipse.

My project is called PayloadSvc. The first part of the pom.xml looks like this:

<modelVersion>4.0.0</modelVersion>
<groupId>PayloadSvc</groupId>
<artifactId>PayloadSvc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

Later in the pom I have this:

<build>
    <finalName>PayloadSvc</finalName>

In eclipse I also have my context root in the Web Project Settings set to PayloadSvc

However, when it deploys into Wildfly it deploys this way:

Registered web context: /PayloadSvc-0.0.1-SNAPSHOT

I can't seem to get it to remove the "-0.0.1-SNAPSHOT" part of the web context.

Oddly enough, other projects in the same workplace work correctly even with the same pom data (with appropriate context, groupId, artifact Id, and the same version attribute of course).

I'm using the STS version of Eclipse Neon.

Thank you for any advice you may have.

like image 286
user3669653 Avatar asked Sep 06 '16 20:09

user3669653


1 Answers

Just had the same problem solved. If you don't have it already, create a WEB-INF\jboss-web.xml file, with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <context-root>PayloadSvc</context-root>
</jboss-web>

Republish the resource and you're done. Not sure why the file is not created automatically though.

like image 89
a_netanel Avatar answered Sep 22 '22 19:09

a_netanel