9

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.

user3669653
  • 354
  • 1
  • 8
  • 15
  • Did you try to do `Right-click > Maven > Update project...` on your project? Also, you could consider giving a try to JBoss Tools. – Mickael Sep 07 '16 at 05:36
  • This is odd. And another developer here confirmed it on his computer. We rolled back from STS based on Eclipse Neon to STS based on Eclipse Mars and it works fine. – user3669653 Sep 07 '16 at 15:03
  • Spoke too soon. Reverting to Mars fixed some of the projects but not others. – user3669653 Sep 07 '16 at 15:26
  • same problem here. what do you mean by STS and how did you change it? – Solano Jan 26 '17 at 12:59

4 Answers4

16

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.

a_netanel
  • 161
  • 1
  • 5
5
  1. Edit the file \[root-of-your-project]\.settings\org.eclipse.wst.common.component, changing the deploy-name attribute and context-root value.
  2. Show the server tab by: Window > Show View > Server
  3. Right click on your server then Add and Remove.... Remove all projects from server.
  4. Right click on your server and clean.
  5. Just to be sure, go to the directory where WildFly is installed and delete the content of the directory [wildfly-path]\[standalone-path]\deployments, if it exits.
  6. Add again the projects into your server and run.
Allan Veloso
  • 5,823
  • 1
  • 38
  • 36
1

Have you tried adding the <name>PayloadSvc</name> element in the root of the pom (same spot as your group,artifact,version elements)?

If that doesn't help, what does the artifact look like when you build it with mvn install? Does it include the version number in the war filename?

alexanderific
  • 780
  • 7
  • 16
  • Yes, I tried the name attribute with no luck. I haven't tried building the war outside of Eclipse with mvn install. However, rolling back from STS based on Neon to STS based on Mars seems to have fixed it. – user3669653 Sep 07 '16 at 15:05
  • This worked for me. However, I had to close the project, remove the resource from wildfly, and restart eclipse. – cditcher Nov 25 '16 at 17:33
0

For Eclipse Neon:

1 Did a Eclipse Neon 'Check for updates' and updated it.

2 I editted file org.eclipse.wst.common.component adding a blank line and saved (check if deploy-name is suffixed with SNAPSHOT).

3 After that the suffix '0.0.1-SNAPSHOT' disappear from the war name when adding it to Wildfly server.

Solano
  • 550
  • 2
  • 9