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

[jooq-codegen-maven] a suggestion for command line arguments for user and password #4631

Closed
jinahya opened this issue Oct 15, 2015 · 3 comments

Comments

@jinahya
Copy link

jinahya commented Oct 15, 2015

Sometimes, specifying user and password in pom.xml can be regarded as a bad practice.

I tried this.

public class Plugin extends AbstractMojo {

    @Parameter(property = "jdbc.user") private String user;
    @Parameter(property = "jdbc.password") private String password;

    @Override
    public void execute() throws MojoExecutionException {
        // ...
            if (user != null) {
                jdbc.withUser(user);
            }
            if (password != null) {
                jdbc.withPassword(password);
            }
            configuration.setJdbc(jdbc);
        // ...
}

Now I can invoke maven with parameters.

$ mvn -Djdbc.user=some -Djdbc.password=some ...
@lukaseder
Copy link
Member

Thanks for your suggestion.

I tend to recommend using external property files and loading them with the properties-maven-plugin. This is explained here, for example:
http://www.petrikainulainen.net/programming/tips-and-tricks/creating-profile-specific-configuration-files-with-maven

Passwords on the command line aren't really best practice either, as you will have them in your command line history - possibly surviving your session. Nonetheless, I can see the value of having additional means of providing parts of the configuration. We'll think about this.

@lukaseder
Copy link
Member

I still don't have a good feeling with this. Clearly, we shouldn't use simple, ambiguous parameters like jdbc.user. The user might pass those to some other plugin / process, but not to the jOOQ plugin. They will apply "by accident".

Once we use longer names, we risk making this new feature too tedious to use, compared to just simply specifying:

<jdbc>
  <user>${jdbc.user}</user>
</jdbc>

The above is just a bit more to type. I think that's not asking too much from users.

I'm thus rejecting this feature request.

@lukaseder
Copy link
Member

We'll implement this through #7011 in jOOQ 3.11

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

No branches or pull requests

2 participants