Skip to content

Conversation

@Marcono1234
Copy link
Contributor

@Marcono1234 Marcono1234 commented Aug 2, 2025

Resolves #399

I compared the resulting JAR files afterwards; there are some small differences:

  • plugin.xml & plugin-help.xml:
    • <description> tags of parameters contain the value of Javadoc tags as plaintext instead of the Javadoc tag, e.g. Determines if {@link #attach} also ... became Determines if attach also ....
      Not sure if that is intended but maybe this is not a big problem (or not a problem at all). The documentation generated by mvn site seems to be unaffected.
    • For the code which was previously using @parameter expression=... I replaced it with @Parameter(defaultValue = "${...}"). I think this should give the same behavior, see also the (old) Maven book.
      This also applies to some usage of @parameter property=...; I think that previously had the desired effect, but to my understanding property is rather intended to define a custom system property which users can use, as it is the case with the existing proguard.skip for this plugin.
  • plugin-help.xml:
    <type> seems to contain the type argument for parameterized types now, e.g. previously it contained just java.util.List, now it is java.util.List<String>.

I have made some basic test and it seems to work fine, but if you have a local test setup it would be great if you could give it a try as well.
Currently in my test I cannot get the <assembly> parameter of the plugin to work, but maybe I am using it incorrectly.

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugins.annotations.Component;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that the Component annotation is marked as deprecated. It seems the standard @Inject annotations should be used instead? See https://maven.apache.org/maven-jsr330.html#how-to-use-jsr-330-in-plugins

But I am not familiar with how this works with Maven (and whether the javax or Jakarta annotations can / should be used). Maybe for now this can keep using this deprecated annotation. Might already be an improvement over the previous Javadoc based variant.

*
* @parameter default-value="${basedir}/proguard.conf"
*/
@Parameter(defaultValue = "${project.basedir}/proguard.conf")
Copy link
Contributor Author

@Marcono1234 Marcono1234 Aug 2, 2025

Choose a reason for hiding this comment

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

The previous ${basedir} value without the project. prefix is deprecated. See https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Model_Variables

or the prefix omitted entirely - these forms are now deprecated and should not be used

* The Jar archiver.
*
* @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
* @required
Copy link
Contributor Author

@Marcono1234 Marcono1234 Aug 2, 2025

Choose a reason for hiding this comment

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

Not sure if there is still a way now to set this 'required'. Though maybe it had no effect before anyway?

Comment on lines -358 to +311
protected String seedFileName = "proguard_seeds.txt";
@Parameter(defaultValue = "proguard_seed.txt")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was also a bug here previously where the initial field value had an extra s after seed: proguard_seeds.txt

But I think the default-value had higher precedence anway, and overwrote the initial field value.

Comment on lines +130 to +131
<!-- Only needed at build time -->
<scope>provided</scope>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines -283 to +289
<localRepositoryPath>${projects.build.directory}/local-repo</localRepositoryPath>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was a typo previously?

@Marcono1234 Marcono1234 marked this pull request as ready for review August 2, 2025 21:14
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.

Use Mojo annotations instead of Javadoc tags

1 participant