-
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
[MNG-7706] Deprecate 'localRepository' parameter expression #1009
[MNG-7706] Deprecate 'localRepository' parameter expression #1009
Conversation
Ironically, ITs report this:
|
maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
Outdated
Show resolved
Hide resolved
...n-core/src/main/java/org/apache/maven/plugin/internal/DeprecatedCoreExpressionValidator.java
Outdated
Show resolved
Hide resolved
Before this is merged, we need to do something with ITs:
|
@@ -40,7 +40,7 @@ | |||
* <tr><td><code>session</code></td> <td></td> <td>the actual {@link MavenSession}</td></tr> | |||
* <tr><td><code>session.*</code></td> <td>(since Maven 3)</td><td></td></tr> | |||
* <tr><td><code>localRepository</code></td> <td></td> | |||
* <td>{@link MavenSession#getLocalRepository()}</td></tr> | |||
* <td>{@link MavenSession#getLocalRepository()} DEPRECATED: Avoid use of {@link org.apache.maven.artifact.repository.ArtifactRepository} type. If you need access to local repository, switch to '${repositorySystemSession}' expression and get LRM from it instead.</td></tr> |
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.
I think some Plugin deleopers might have no clue what LRM is, probabbly also give a link to the wiki/jira/... that explains some details.
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.
Updated javadoc, added link to the issue. Issue updated with "how to fix" https://issues.apache.org/jira/browse/MNG-7706
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 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. * 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/maven#1009
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/maven#1009
This PR deprecates the 'localRepository' mojo parameter expression, and Core will emit warning if used by any Mojo. --- https://issues.apache.org/jira/browse/MNG-7706
b7fc8d8
to
f55f5cb
Compare
) This PR deprecates the 'localRepository' mojo parameter expression, and Core will emit warning if used by any Mojo. --- https://issues.apache.org/jira/browse/MNG-7706
…1012) This PR deprecates the 'localRepository' mojo parameter expression, and Core will emit warning if used by any Mojo. --- https://issues.apache.org/jira/browse/MNG-7706
In practical terms, what does this mean for people with |
As description says "This PR deprecates the 'localRepository' mojo parameter expression". Has nothing to do with |
Moreover, please use mailing lists for these sort of questions, not old/closed pull requests https://maven.apache.org/mailing-lists.html |
I upgrade to 3.9.x, I see a warning, and I have a single place where I use "localRepository". Maybe make messages more clear, make release notes more clear, and upgrade your communication channels to something more usable. |
This is a project maintained by volunteers, hence you can contribute as well! Feel free to produce as many quality patches and other improvements project-wise as you like! We will be glad to review them 😺 |
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
This PR deprecates the 'localRepository' mojo parameter expression, and Core will emit warning if used by any Mojo.
https://issues.apache.org/jira/browse/MNG-7706