-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 missing version in extension #442
Merged
gsmet
merged 3 commits into
master
from
features/fix-missing-version-in-generated-project
Jan 8, 2019
Merged
Fix missing version in extension #442
gsmet
merged 3 commits into
master
from
features/fix-missing-version-in-generated-project
Jan 8, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gsmet
reviewed
Jan 7, 2019
@@ -91,7 +92,7 @@ public static boolean addExtensions(Model model, List<String> extensions, Log lo | |||
if (!MojoUtils.hasDependency(model, optional.get().getGroupId(), optional.get().getArtifactId())) { | |||
log.info("Adding extension " + optional.get().toCoordinates()); | |||
|
|||
if (containsBOM(model)) { | |||
if (containsBOM(model) && optional.get().getGroupId().startsWith(CreateProjectMojo.PLUGIN_GROUPID)) { |
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.
We can't parse the BOM somehow and check if the dependency is defined in the BOM?
Unfortunately not, it would require to compute the effective pom, which
would be quite expensive.
I agree it not a great solution, but this extension support is temporary
anyway.
…On Mon 7 Jan 2019 at 17:43, Guillaume Smet ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
maven/src/main/java/org/jboss/shamrock/maven/components/dependencies/Extensions.java
<#442 (comment)>
:
> @@ -91,7 +92,7 @@ public static boolean addExtensions(Model model, List<String> extensions, Log lo
if (!MojoUtils.hasDependency(model, optional.get().getGroupId(), optional.get().getArtifactId())) {
log.info("Adding extension " + optional.get().toCoordinates());
- if (containsBOM(model)) {
+ if (containsBOM(model) && optional.get().getGroupId().startsWith(CreateProjectMojo.PLUGIN_GROUPID)) {
We can't parse the BOM somehow and check if the dependency is defined in
the BOM?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#442 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAYjfUE5CudUe2P5f-W-4gI_OXg_LrqVks5vA3k3gaJpZM4Zz1iy>
.
|
Once the dependency is added to the bon we just need to remove the hard
coded version from the extension list.
On Mon 7 Jan 2019 at 17:44, clement escoffier <clement.escoffier@gmail.com>
wrote:
… Unfortunately not, it would require to compute the effective pom, which
would be quite expensive.
I agree it not a great solution, but this extension support is temporary
anyway.
On Mon 7 Jan 2019 at 17:43, Guillaume Smet ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In
> maven/src/main/java/org/jboss/shamrock/maven/components/dependencies/Extensions.java
> <#442 (comment)>
> :
>
> > @@ -91,7 +92,7 @@ public static boolean addExtensions(Model model, List<String> extensions, Log lo
> if (!MojoUtils.hasDependency(model, optional.get().getGroupId(), optional.get().getArtifactId())) {
> log.info("Adding extension " + optional.get().toCoordinates());
>
> - if (containsBOM(model)) {
> + if (containsBOM(model) && optional.get().getGroupId().startsWith(CreateProjectMojo.PLUGIN_GROUPID)) {
>
> We can't parse the BOM somehow and check if the dependency is defined in
> the BOM?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#442 (review)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAYjfUE5CudUe2P5f-W-4gI_OXg_LrqVks5vA3k3gaJpZM4Zz1iy>
> .
>
|
Actually there is a solution IF the bom does not use another bom. Let me
try that
On Mon 7 Jan 2019 at 17:45, clement escoffier <clement.escoffier@gmail.com>
wrote:
… Once the dependency is added to the bon we just need to remove the hard
coded version from the extension list.
On Mon 7 Jan 2019 at 17:44, clement escoffier ***@***.***>
wrote:
> Unfortunately not, it would require to compute the effective pom, which
> would be quite expensive.
>
> I agree it not a great solution, but this extension support is temporary
> anyway.
>
> On Mon 7 Jan 2019 at 17:43, Guillaume Smet ***@***.***>
> wrote:
>
>> ***@***.**** commented on this pull request.
>> ------------------------------
>>
>> In
>> maven/src/main/java/org/jboss/shamrock/maven/components/dependencies/Extensions.java
>> <#442 (comment)>
>> :
>>
>> > @@ -91,7 +92,7 @@ public static boolean addExtensions(Model model, List<String> extensions, Log lo
>> if (!MojoUtils.hasDependency(model, optional.get().getGroupId(), optional.get().getArtifactId())) {
>> log.info("Adding extension " + optional.get().toCoordinates());
>>
>> - if (containsBOM(model)) {
>> + if (containsBOM(model) && optional.get().getGroupId().startsWith(CreateProjectMojo.PLUGIN_GROUPID)) {
>>
>> We can't parse the BOM somehow and check if the dependency is defined in
>> the BOM?
>>
>> —
>> You are receiving this because you authored the thread.
>> Reply to this email directly, view it on GitHub
>> <#442 (review)>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AAYjfUE5CudUe2P5f-W-4gI_OXg_LrqVks5vA3k3gaJpZM4Zz1iy>
>> .
>>
>
|
Inject the project builder and resolver.
@gsmet I've updated the PR to resolve the dependencies from the BOM and check whether the given extension is defined in the bom file. |
Looks good, thanks, merging! |
cescoffier
deleted the
features/fix-missing-version-in-generated-project
branch
January 14, 2019 12:33
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue reported in #441.
When the bom is present the version is not set in the
pom.xml
file.