I try to evaluate whether my java program as well as all of its dependencies (including transitive ones) fit the java compact3 profile.
I can compile my program with the -profile compact3
compiler switch, but this will only check my program.
How can I automatically (e.g. using maven) validate that all dependencies meet the profile requirement? I could checkout the source for all dependencies and build them manually with the above compiler switch, but this is impracticable.
There is a jdeps-maven-plugin that is suitable for your use case
Add this to pom.xml
<build>
<plugins>
<plugin>
<groupId>com.github.marschall</groupId>
<artifactId>jdeps-maven-plugin</artifactId>
<version>0.4.0</version>
<configuration>
<profile>true</profile>
<recursive>true</recursive>
</configuration>
</plugin>
</plugins>
</build>
Then run
$ mvn jdeps:jdeps
Unfortunately the plugin does not support automatic failing of builds if profile requirements are not met, but one can write an external script to process the output.
e.g.
mvn jdeps:jdeps | awk '/ ->/ && /Full/ {print}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With