Generator-jhipster: Missing dependencies from vanilla project when running in Idea in Windows

Created on 4 Jun 2017  Â·  9Comments  Â·  Source: jhipster/generator-jhipster

Overview of the issue

A vanilla project (Angular, MySQL, Maven) won't start from inside IntelliJ Idea (Community Edition v2017.1.3) without adding the following dependencies as provided:

Motivation for or Use Case

Because it should Just Workâ„¢ - everything else does in JHipster :)

Reproduce the error
  1. Generate a standard JHipster project.
  2. In IntelliJ Idea, choose File->New->Project from Existing Sources, and import the generated pom.xml
  3. Enable autoimport and activate the IDE profile
  4. Clean and build the project:
    JWTFilter won't compile without the Servlet dependencies
    WebConfigurer won't compile without the the Undertow dependencies
  5. The app won't start by running the Maven project from inside Idea but will run from the command line with mvnw.
    6 . Add the dependencies listed above, all OK.
Suggest a Fix

Add the listed dependencies to the generated pom automatically, or add something to the IDE documentation, as the project obviously runs from the command line.

JHipster Version(s)

4.5.2

JHipster configuration

C:UsersrichiDocumentsprojectsjhipstertest8>jhipster info
Executing jhipster:info
Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
[email protected] C:\Users\richi\Documents\projects\jhipstertest8
+-- UNMET PEER DEPENDENCY @angular/[email protected]
+-- UNMET PEER DEPENDENCY @angular/[email protected]
`-- [email protected]

JHipster configuration, a .yo-rc.json file generated in the root folder
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.mycompany.myapp",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "4.5.2",
    "baseName": "jhipstertest8",
    "packageName": "com.mycompany.myapp",
    "packageFolder": "com/mycompany/myapp",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "hibernateCache": "no",
    "clusteredHttpSession": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "jwtSecretKey": "07d06b444063ad06d43ef4f7e39acf743f1f4661",
    "clientFramework": "angular2",
    "useSass": false,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "fr"
    ]
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

ls: no such file or directory: .jhipster/*.json

Browsers and Operating System

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

git version 2.13.0.windows.1

node: v7.10.0

npm: 4.2.0

bower: 1.8.0

gulp:
[10:43:18] CLI version 1.3.0

yeoman: 1.8.5

yarn: 0.24.6

Execution complete

{
"generator-jhipster": {
"promptValues": {
"packageName": "com.mycompany.myapp",
"nativeLanguage": "en"
},
"jhipsterVersion": "4.5.2",
"baseName": "jhipstertest8",
"packageName": "com.mycompany.myapp",
"packageFolder": "com/mycompany/myapp",
"serverPort": "8080",
"authenticationType": "jwt",
"hibernateCache": "no",
"clusteredHttpSession": false,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "mysql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSocialSignIn": false,
"jwtSecretKey": "07d06b444063ad06d43ef4f7e39acf743f1f4661",
"clientFramework": "angular2",
"useSass": false,
"clientPackageManager": "yarn",
"applicationType": "monolith",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": [
"en",
"fr"
]
}
}

Entity configuration(s) entityName.json files generated in the .jhipster directory

I have this problem even without any entities.

Browsers and Operating System

Windows 10

  • [X] Checking this box is mandatory (this is just to show you read everything)

Most helpful comment

I'm on Windows and use IDEA too. I see this same behavior if "dev" profile is not selected (you must have unselected it on prooject import). I set both dev and "IDE" profile (needed for current mapper unit tests but won't be need in the next JHipster release). From the Maven tab on the right of the window select 'Reimport all Maven Dependencies' button and it will download the missing dependencies after you update the profile settings.

All 9 comments

You understimate how JHipster "just works" :-)
You don't need to create a new project, just open the existing project and it works out of the box !

@richiethom you need to have the "dev" (or prod) profile activated

"dev" is activated by default

I'm on Windows and use IDEA too. I see this same behavior if "dev" profile is not selected (you must have unselected it on prooject import). I set both dev and "IDE" profile (needed for current mapper unit tests but won't be need in the next JHipster release). From the Maven tab on the right of the window select 'Reimport all Maven Dependencies' button and it will download the missing dependencies after you update the profile settings.

@tezcane That works for me too. Thanks!

@jdubois It might be worth putting this into the documentation somewhere :)

I thought it was documented, I'll take a look before closing this

I remember there was mention of IDE profile in the using profiles page, but now its not there anymore. In anycase I think if we override the default profile then we need to specify either dev or prod explicitly.

@tezcane
Thanks for the help.
For some reason when selecting the IDE profile, the dev profile is unchecked (I originally did not notice it).
Once I made sure that both profiles are selected it all worked.

This could be noted in the documentation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lsadehaan picture lsadehaan  Â·  3Comments

frantzynicolas picture frantzynicolas  Â·  3Comments

SudharakaP picture SudharakaP  Â·  3Comments

pascalgrimaud picture pascalgrimaud  Â·  3Comments

dronavallisaikrishna picture dronavallisaikrishna  Â·  3Comments