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

Fix #143 Enhance overrideFile with overrideUrl #181

Merged
merged 1 commit into from
Jan 4, 2019

Conversation

ppalaga
Copy link
Contributor

@ppalaga ppalaga commented Jan 3, 2019

Based on #153 by
@Jurrie with enhancements by @ppalaga

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 3, 2019

@Jurrie, could you please review?

Copy link

@Jurrie Jurrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Peter, thanks for continuing this enhancement. Sorry I didn't find time to improve my PR; this is a bit of an on-off side project for me I'm afraid :)

{
try
{
return deprecatedFile.toURI().toURL();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should a warning be emitted telling the user he is using a deprecated setting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not want to clutter this method with yet another argument. Let me have a look if I can add the warning elsewhere.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you just do a getLogger().warn("!!! overrideFile is deprecated, use now overrideUrl !!!"); in the body of the if that's on line 95?

/**
* Hidden
*/
private LicenseMojoUtils()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the class be declared final? After all, it's a utility class with a private constructor...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

* @since 1.17
*/
@Parameter( property = "license.overrideUrl" )
private String overrideUrl;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as PR 153: I think it should be documented what the file contents should look like.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code seems to expect a property file but looking at DefaultThirdPartyTool, I am not able to tell quickly enough what mapping should that be. Names to names or URLs to URLs or something else? Where is that mapping used, actually?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's documented here. I simply needed the ability to share an override file with other teams in my company, so I didn't investigate where in the code the mapping was used.

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 4, 2019

1663932 replaces 1b33113 adding the following:

  • Warning when overrideFile is used
  • LicenseMojoUtils made final

No idea how to document the overrideUrl

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 4, 2019

5bda7d7 fixes the formatting

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 4, 2019

There is a hint about the override file content in

For each dependency you want to fix, just add in this properties file a line
-------------------------------------------------------------------------------
org.jboss.xnio--xnio-api--3.3.6.Final=The Apache Software License, Version 2.0
-------------------------------------------------------------------------------
would that be the right thing to add to the JavaDoc of the overrideUrl fields?

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 4, 2019

@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 4, 2019

21d1a7b just a rebase on top of the current master

@Jurrie
Copy link

Jurrie commented Jan 4, 2019

4587871 documents the override file format in the mojo params https://github.com/mojohaus/license-maven-plugin/pull/181/files#diff-0bfb2b7e70b9abacb4339555c7b49e81R268 and https://github.com/mojohaus/license-maven-plugin/pull/181/files#diff-9124975c1831b088259ed63a7d9de25bR202

@Jurrie could you please review and eventually give the final approval?

@ppalaga all ok for me, but there's one thing left on emitting a warning when using deprecated stuff. Was it your intention to leave that as-is?

@ppalaga ppalaga merged commit 4246631 into mojohaus:master Jan 4, 2019
@ppalaga
Copy link
Contributor Author

ppalaga commented Jan 4, 2019

Thanks for your contribution, @Jurrie !

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

Successfully merging this pull request may close these issues.

None yet

2 participants