Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change spring run profile - always it starts with dev,swagger when on Maven #6947

Closed
dexterxx-pl opened this issue Jan 5, 2018 · 3 comments
Milestone

Comments

@dexterxx-pl
Copy link

dexterxx-pl commented Jan 5, 2018

Overview of the issue

I've already wrote what's problem here: 995bf17#commitcomment-26665675

Looks like from v4.12.0 and newer applications may be affected with stuck-spring-profile-selection which always runs app on dev,swagger (default) profiles.
It's impossible to run app in other profile with mvnw command.

Motivation for or Use Case

Can't run app in other profile using maven :).

Reproduce the error

Use .yo-rc.json in linked commit above to regenerate application and try to start it with mvnw -Pprod command. App will start in dev,swagger profile which is wrong behavior.

Related issues

Not founded anything fresh related to that.

Suggest a Fix

Suggestion is proposed in linked above commit.
However whole configuration should be based on spring maven plugin - https://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/run-profiles.html

JHipster Version(s)

v4.13.1 and v4.13.2 is affected.
Probably v4.12.0 and newer too (not tested).

JHipster configuration
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.whatever",
      "nativeLanguage": "pl"
    },
    "jhipsterVersion": "4.13.1",
    "baseName": "Whatever",
    "packageName": "com.whatever",
    "packageFolder": "com.whatever",
    "serverPort": "12345",
    "authenticationType": "uaa",
    "uaaBaseName": "UAA",
    "hibernateCache": "no",
    "clusteredHttpSession": false,
    "websocket": false,
    "databaseType": "no",
    "devDatabaseType": "no",
    "prodDatabaseType": "no",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "1234",
    "enableTranslation": true,
    "applicationType": "microservice",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "skipClient": true,
    "skipUserManagement": true,
    "nativeLanguage": "pl",
    "languages": [
      "pl",
      "en"
    ],
    "clientPackageManager": "yarn",
    "cacheProvider": "no",
    "enableHibernateCache": false
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

Not needed.

Browsers and Operating System

Not related (really not related! @PierreBesson below) .

@PierreBesson
Copy link
Contributor

Please add your .yo-rc.json here, this is part of our guidelines. And you don't get to choose that your browser/OS info is not related (you can use the jhipster info command to generate all needed info).

I have also noticed this problem a few days ago, and I was going to fix it. Actually it only happens for apps that use spring cloud config and bootstrap.yml as it is in this file that the profile is set by property substitution. A recent change has disabled this substitution for this file so that's what's causing the problem.

PierreBesson added a commit to PierreBesson/generator-jhipster that referenced this issue Jan 5, 2018
dexterxx-pl referenced this issue Jan 5, 2018
@jdubois
Copy link
Member

jdubois commented Jan 5, 2018

It looks like this only occurs for microservices -> in that case, it would be good to change the title, to provide more information

@jdubois jdubois closed this as completed in 9cbed2c Jan 5, 2018
@jdubois jdubois added this to the 4.13.3 milestone Jan 9, 2018
@apovn
Copy link

apovn commented Oct 26, 2018

for anyone still get this error in spring boot 1.5.7, let comment out all code in config/bootstrap.yml.

after that:
config/application.yml => spring.profiles.active=prod => will take affect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants