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
Adds the possibility to override values while generating the extension.json as described by issue #4320 #4861
Conversation
@@ -59,6 +64,9 @@ | |||
@Parameter(property = "bomVersion", defaultValue = "${project.version}") | |||
private String bomVersion; | |||
|
|||
@Parameter(property = "overridesFile", defaultValue = "${project.basedir}/src/main/resources/extensions-overrides.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems fishy - users can ovveride the name of resources folder - isn't there a more maven agnostic way to look these up ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${project.build.outputDirectory}
the resources will end up being there, also possibly filtered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using ${project.build.outputDirectory}
doesn't seem to work. There's no output directory basically (there's just target
, no target/classes
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before I was using ${project.resources[0].resource}
but that doesn't work. The expression is probably too complex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why is this fishy? All paths are basically overridable, right? I mean is there some way this could be abused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah this the defaultvalue...oh well then i don't care at this stage - maybe post 1.0 if ever ;)
} | ||
} catch (IOException e) { | ||
throw new IOException("Failed to parse " + descriptor, e); | ||
} | ||
} | ||
|
||
private String extensionId(JsonObject extObject) { | ||
return extObject.getString("groupId", "") + "." + extObject.getString("artifactId"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this gives a NPE if you forget to put groupid/artifactid in extension entry. need to handle that better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Left a few minor comments - if fixed lets merge it. One issue is though that using this does not result in categories being in the final document:
|
} | ||
} catch (IOException e) { | ||
throw new IOException("Failed to parse " + descriptor, e); | ||
} | ||
} | ||
|
||
private String extensionId(JsonObject extObject) { | ||
return extObject.getString("groupId", "") + "." + extObject.getString("artifactId"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not keep the traditional :
as a separator? It'll work either way but it'l be more intuitive and easier to read in case we need to display those if it is :
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@maxandersen where is that defined? I don't see anything about a categories section at the toplevel of that document being discussed in the issue? |
0f9571c
to
0e6f1f1
Compare
because there aren't any (yet). in this case they are just added during this patching. |
I expected that just as I added a new "status" property inside extension I could add new "categoreies" property at the root. |
@maxandersen well that's very easy to do if you want that :-) |
@maxandersen well actually it's not that trivial, now that I think about it. So are you sure you want this? It's not the work (probably 15mins) but it's more about adding features that might need to be maintained etc |
We need someway to add categories. If not using this patch approach then we can do a separate file and bulk add it in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
rebased against master and now merged. |
Issue #4320