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

Remove unused code that triggers Error Prone. #245

Closed

Conversation

josephw
Copy link
Contributor

@josephw josephw commented Apr 20, 2019

Running Error Prone over Maven triggers an infinite recursion
check in AbstractCoreMavenComponentTestCase.PluginBuilder; on
inspection, the class is unused. Remove it, along with the commented-
out (since bc257a5) reference to it.

Running Error Prone over Maven triggers an infinite recursion
check in AbstractCoreMavenComponentTestCase.PluginBuilder; on
inspection, the class is unused. Remove it, along with the commented-
out (since bc257a5) reference to it.
asfgit pushed a commit that referenced this pull request Apr 20, 2019
Running Error Prone over Maven triggers an infinite recursion
check in AbstractCoreMavenComponentTestCase.PluginBuilder; on
inspection, the class is unused. Remove it, along with the commented-
out (since bc257a5) reference to it.
asfgit pushed a commit that referenced this pull request Apr 20, 2019
Running Error Prone over Maven triggers an infinite recursion
check in AbstractCoreMavenComponentTestCase.PluginBuilder
@slachiewicz
Copy link
Member

Thx, done in fdde73f

@josephw
Copy link
Contributor Author

josephw commented Apr 21, 2019

Closing, as this was merged with a rewritten commit.

@josephw josephw closed this Apr 21, 2019
@josephw josephw deleted the remove-unused-test-code-with-error branch May 12, 2019 12:56
gnodet pushed a commit to gnodet/maven that referenced this pull request Nov 20, 2024
The MNG-7706 deprecates ancient ArtifactRepository type use to get access to local repository, and issues warning as for any other deprecated Mojo parameters.

But alas, in ITs the MNG-5576 completely unrelated IT there is an assertion to have WARNING-free log. This IT uses the IT-plugins/IT-plugin-expression EvalMojo, that in turn uses the deprecated `${localRepository}` parameter (but does not use it). Result is, Maven 3.9.1 emits a WARNING about use of deprecated parameter and the IT fails.

Further inspection shows, that while EvalMojo injects ArtifactRepository for local repository, there is only one IT that actually uses it, the MNG-4305, but even that one is interested in basedir of the local repository only. So to say, the use of deprecated ArtifactRepository type is not needed at all.

Fix:
* change EvalMojo to not expose in context the localRepository (w/ type ArtifactRepository), but a new expression `localRepositoryBasedir` only, that is injected in non-deprecated way (in real life repoSysSession would be injected, but in IT we keep all super-safe and use Object types).
* adjusted MNG-4305 to use new epxression instead to use object reflection in template to get basedir from ArtifactRepository
* This makes the originally failing MNG-5576 pass, as warning due EvalMojo is gone.

See
https://issues.apache.org/jira/browse/MNG-7706
apache#1009
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.

2 participants