generator-jhipster: v4.11.0 : Building a production War with Maven fails for microservices

Overview of the issue

mvnw package -Pprod,swagger,zipkin

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.6:war (default-war) on project psi: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)
psi@0.0.0 F:\jhipster\anjia\psi
`-- generator-jhipster@4.11.0

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.anjia.psi",
      "nativeLanguage": "zh-cn"
    },
    "jhipsterVersion": "4.11.0",
    "baseName": "psi",
    "packageName": "com.anjia.psi",
    "packageFolder": "com/anjia/psi",
    "serverPort": "8085",
    "authenticationType": "jwt",
    "hibernateCache": "hazelcast",
    "clusteredHttpSession": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "replaced-by-jhipster-info",
    "enableTranslation": true,
    "applicationType": "microservice",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "nativeLanguage": "zh-cn",
    "languages": [
      "zh-cn"
    ],
    "clientPackageManager": "yarn",
    "skipClient": true,
    "skipUserManagement": true
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions




Environment and Tools

java version “1.8.0_121” Java™ SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot™ 64-Bit Server VM (build 25.121-b13, mixed mode)

git version 2.11.0.windows.3

node: v8.8.1

npm: 5.4.2

yeoman: 2.0.0

yarn: 1.3.2

os:windows 10 build 1703

Docker version 17.06.2-ce, build cec0b72

docker-compose version 1.14.0, build c7bdf9e3

Congratulations, JHipster execution is complete!

Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 23 (23 by maintainers)

Most upvoted comments

Many thanks again to @pascalgrimaud @MathieuAA @deepu105 it’s incredible that you are all available on a Sunday!!! 👍 And also thanks to @anjia0532 for this really important bug report! 👍

I think I got the fix. Helped by: https://stackoverflow.com/questions/23114155/spring-boot-without-parent-pom-xml-cannot-generate-war-packaging

This line need to be added for microservices, for dev and prod profile: https://github.com/jhipster/generator-jhipster/blob/master/generators/server/templates/_pom.xml#L1217

Let me few minutes to test everything and I can PR

Don’t be sorry for that @anjia0532 ! Thank you for reporting ! I had some time this morning between 2 coffees 😃