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

POM placeholder variables prevent project from building correctly #13

Open
cjnickel opened this issue Aug 14, 2018 · 6 comments
Open

POM placeholder variables prevent project from building correctly #13

cjnickel opened this issue Aug 14, 2018 · 6 comments

Comments

@cjnickel
Copy link
Contributor

cjnickel commented Aug 14, 2018

With certain variables being set as placeholders in pom.xml, api.server.properties, and api.local.properties I run into Anypoint Studio errors that prevent project from building due to recursive cycles.

Example:

Setting database url values as ${policyholder.jdbc.url} in each of these files which requires devs to pass in via run configuration results in the error icon for project.
image
image
image
Note that passing in a -D parameter still has error

Potential Fix:

Setting the database url to an empty xml tag in pom.xml resolves the issue.
e.g. <policyholder.jdbc.url />

@cjnickel
Copy link
Contributor Author

@aoathout - You know maven and pom best. Any suggestions?

@TrueWill
Copy link
Contributor

@cjnickel It's easy enough to check any property in the POM; I just need to know what to check it against. For instance mulint could validate that any property with a name containing "jdbc.url" had an empty value.

@aoathout
Copy link

@cjnickel I would have to pull the project down to take a look at why it isn't resolving when passing things in with '-D'. I can take a look once I get billing-process-api migrated to use wsflx

@aoathout
Copy link

aoathout commented Aug 14, 2018

@cjnickel I did some more tests on this. I changed the pom.xml to have the following for the jdbc.url:
<policyholder.jdbc.url>jdbc:sqlserver://CRSQLDEV01.cr.unitedfiregroup.com;databaseName=CustomerPortal;integratedSecurity=true;</policyholder.jdbc.url>

The api.local.properties and api.server.properties files have the following for the jdbc url:
policyholder.jdbc.url=${policyholder.jdbc.url}

I set my run configuration maven params to this so I could run it since I can't do integrated auth (passwords removed):
-Dmule.env=local "-Dpolicyholder.jdbc.url=jdbc:sqlserver://CRSQLDEV01.cr.unitedfiregroup.com;databaseName=CustomerPortal;user=ESB_CustomerPortal;password=;"

I add this to my munit run configurations (passwords removed):
-Dmule.env=local
-Dhttps.port=8443
-Dpolicyholder.jdbc.url=jdbc:sqlserver://CRSQLDEV01.cr.unitedfiregroup.com;databaseName=CustomerPortal;user=ESB_CustomerPortal;password=;

I can build from the command line. I can run the server and get results and I can run my munits in Studio

Mulint does give this message:
POM policyholder.jdbc.url: expected "${policyholder.jdbc.url}" but was "jdbc:sqlserver://CRSQLDEV01.cr.unitedfiregroup.com;databaseName=CustomerPortal;integratedSecurity=true;"

Maybe we can check for an exact match, or for placeholder in that mulint check

@cjnickel
Copy link
Contributor Author

cjnickel commented Aug 15, 2018

@aoathout - Yeah, I wasn't sure if we wanted to default the pom.xml to integrated auth since a majority of devs are on Windows still. Like you mentioned we'll still have to specify a value in munit test configurations. I've been putting a random string since we're not doing integration tests (obviously will adjust that if/when we have integration tests).

Do the following rules sound correct:

  • Does not contain password
  • Is not placeholder in POM e.g. ${policyholder.jdbc.url}
  • Can be blank but key must still be in POM?
  • Property files should both have placeholder e.g. ${policyholder.jdbc.url}

I would expect this approach may change with mule 4 / studio 7 as it sounds like that honors POM better but maybe then we can switch it to have jdbc url with a placeholder for the password?

Side Note We should probably figure out how to distribute credentials securely. I think IT department has something that tracks credentials but not positive.

@cjnickel
Copy link
Contributor Author

@TrueWill @aoathout
There is also the property encryption within Anypoint Studio here and here. This does still require us to track the keys and encryption algorithm we used to encrypt though.

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

3 participants