Skip to content

Default value must be manually handled - #953

Merged
cstamas merged 2 commits into
apache:masterfrom
cstamas:fix-912
May 22, 2024
Merged

cstamas merged 2 commits into
apache:masterfrom
cstamas:fix-912

Conversation

@cstamas

@cstamas cstamas commented Apr 20, 2024

Copy link
Copy Markdown
Member

Default must be manually handled, i missed this.

Fixes #912

@wendigo

wendigo commented Apr 20, 2024

Copy link
Copy Markdown

That works :) Thanks!

@cstamas

cstamas commented Apr 20, 2024

Copy link
Copy Markdown
Member Author

Am adding IT (something I'd done initially would catch this), and will merge

@cstamas

cstamas commented Apr 20, 2024 •

Copy link
Copy Markdown
Member Author

The code change is OK and fixes issue, but something else is wrong.
Created #957

The maven.config is ignored by mvnd, hence it tries (local repo shows the attempt) to load extension foo:bar but naturally fails, but continues instead to fail the build.

@wendigo

wendigo commented Apr 22, 2024

Copy link
Copy Markdown

Can we get this in for alpha14?

@cstamas

cstamas commented Apr 22, 2024

Copy link
Copy Markdown
Member Author

Sure, this will be in it. But as i wrote, seems there is something else to be fixed as IT this PR adds shows...

@cstamas

cstamas commented Apr 22, 2024

Copy link
Copy Markdown
Member Author

@gnodet If you run this PR locally:

  • it will pass ok, but
  • maven-conf-ignore-ext IT is wrong: maven.conf where ignore is, is not observed by mvnd. Also local repository will show that extension foo:bar is attempted to resolve, but naturally unsuccessfully
  • this means that mvnd happily goes along instead to fail (as it failed to resolve the extension)

Any idea?

@gnodet

gnodet commented Apr 22, 2024

Copy link
Copy Markdown
Contributor

@gnodet If you run this PR locally:

  • it will pass ok, but
  • maven-conf-ignore-ext IT is wrong: maven.conf where ignore is, is not observed by mvnd. Also local repository will show that extension foo:bar is attempted to resolve, but naturally unsuccessfully
  • this means that mvnd happily goes along instead to fail (as it failed to resolve the extension)

Any idea?

Yes, the problem is here:

String exclusionsString =
systemProperty(Environment.MVND_CORE_EXTENSIONS_EXCLUDE).asString();
String exclusionsString = systemProperty(Environment.MVND_CORE_EXTENSIONS_EXCLUDE)
.asOptional()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this should be:

String exclusionsString =
                systemProperty(Environment.MVND_CORE_EXTENSIONS_EXCLUDE).orDefault().asString();

.filter(e -> !exclusions.contains(e.getGroupId() + ":" + e.getArtifactId()))
.collect(Collectors.toList());
if (!exclusions.isEmpty()) {
LOG.info("Excluded extensions (GA): {}", exclusions);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should definitely not be part of the output, and not 4 times.
I'll revert this chunk, or log to debug at most.

@cstamas

cstamas commented Apr 23, 2024

Copy link
Copy Markdown
Member Author

Unsure why ubuntu failed, win passed.... locally also passed w/ same CLI params as CI invoked 🤔

"io.takari.maven:takari-smart-builder",
OptionType.STRING,
Flags.OPTIONAL),
Flags.DISCRIMINATING | Flags.OPTIONAL),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this one is discriminating. What is discriminating is the list of extensions to load which may actually be affected by this property, but not necessarily. If you add an exclusion which is not supposed to be loaded, this won't affect the result. In addition, that property is not really interesting on the daemon side, as the extensions list is loaded by the client...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removed

cstamas added a commit to cstamas/maven-mvnd that referenced this pull request May 22, 2024
Default must be manually handled, i missed this.

Fixes apache#912

Backport of apache#953 to mvnd-1.x
@cstamas
cstamas merged commit 6de7431 into apache:master May 22, 2024
@cstamas
cstamas deleted the fix-912 branch May 22, 2024 14:33
cstamas added a commit that referenced this pull request May 22, 2024
Default must be manually handled, i missed this.

Fixes #912

Backport of #953 to mvnd-1.x
slachiewicz pushed a commit that referenced this pull request Nov 15, 2026
(cherry picked from commit 6de7431)
Only the integration tests are taken, the fix is already on this branch; kept the 1.x interpolation and multiModuleProjectDirectory tests next to the new mvndParams() hook.
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.

Detect smart builder in .mvn/extensions.xml and ignore it

4 participants