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

Please provide options to exclude some values from the generated git.properties #3

Closed
tha2015 opened this issue Jan 12, 2016 · 6 comments

Comments

@tha2015
Copy link
Collaborator

tha2015 commented Jan 12, 2016

I'm like to exclude some properties from generated git.properties

git.commit.user.email
git.commit.user.name
git.commit.message.short
git.commit.message.full

Please provide options to exclude these properties. Thanks.

@n0mer
Copy link
Owner

n0mer commented Jan 13, 2016

@tha2015 what properties do you actually want to see and care about?

@tha2015
Copy link
Collaborator Author

tha2015 commented Jan 13, 2016

Currently the plugin always generates 8 below properties

git.commit.id
git.commit.time
git.commit.id.abbrev
git.branch
git.commit.user.name
git.commit.user.email
git.commit.message.short
git.commit.message.full

But I just want to 4 properties as below
git.commit.id
git.commit.time
git.commit.id.abbrev
git.branch

I don't want to 4 other properties
git.commit.user.name
git.commit.user.email
git.commit.message.short
git.commit.message.full

The reason is because I don't want to make visible some information in the output JAR file.

Thanks for the plugin.

n0mer added a commit that referenced this issue Jan 20, 2016
@n0mer
Copy link
Owner

n0mer commented Jan 21, 2016

@tha2015 please try 1.4.9 version, it now has new config parameter keys.

if omitted, then by default all keys will be printed.

if you define

gitProperties {
    keys = ['git.branch', 'git.commit.id', 'git.commit.id.abbrev', 'git.commit.time']
}

then plugin will put only these properties.

@tha2015
Copy link
Collaborator Author

tha2015 commented Jan 22, 2016

I got the below error

  • What went wrong:
    A problem occurred evaluating root project 'sample'.

    Cannot cast object '[git.branch, git.commit.id, git.commit.id.abbrev, git.commit.time]' with class 'java.util.ArrayList' to class 'java.util.Map' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.Map(java.lang.String, java.lang.String, java.lang.String,
    java.lang.String)

I think it is because keys is defined as a Map in the below class

 class GitPropertiesPluginExtension {
    ...
    Map keys
}

I guess it should be defined as a List instead.

n0mer added a commit that referenced this issue Jan 23, 2016
@n0mer
Copy link
Owner

n0mer commented Jan 23, 2016

@tha2015 , you're right - please try just published v1.4.10

@tha2015
Copy link
Collaborator Author

tha2015 commented Jan 23, 2016

It works well now. Thank you very much.

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

2 participants