Closed mbooth101 closed 4 years ago
Idea: introduce %mvn_prep
macro that would remove these plugins. In future it could be extended to do other cleanup (such as removal of bundled *.class etc.) What do you think?
Interesting. What if %mvn_build
could do it to avoid introducing another macro? Doing it at the start of %build has the same net effect as doing it at the end of %prep...
I would prefer if modification of POM files was done before %build
section - this way you can examine contents of POM files used during build, or short-circuit rpmbuild phases.
Alternative approach that doesn't require adding extra macro calls to spec files would be to dynamically modify Maven model without modifying POM files on disk. This approach is already used by XMvn, for example to remove test dependencies when %mvn_build
is called with -f
. See customizeModel() method of XMvnModelValidator. That method could be extended to remove blacklisted plugins or even dependencies, based on configuration.
Alternative approach that doesn't require adding extra macro calls to spec files would be to dynamically modify Maven model without modifying POM files on disk. This approach is already used by XMvn, for example to remove test dependencies when
%mvn_build
is called with-f
. See customizeModel() method of XMvnModelValidator. That method could be extended to remove blacklisted plugins or even dependencies, based on configuration.
Hmm, I like this way even more...
@mbooth101 Please review PR #71 - it adds a global list of plugins which will be dynamically removed from Maven model during build, without modifying POM files on disk. If this looks good then I'll merge it.
@mbooth101 Please review PR #71 - it adds a global list of plugins which will be dynamically removed from Maven model during build, without modifying POM files on disk. If this looks good then I'll merge it.
Yeah that looks correct to me
@mbooth101 Please review PR #71 - it adds a global list of plugins which will be dynamically removed from Maven model during build, without modifying POM files on disk. If this looks good then I'll merge it.
Actually I have one more addition:
apache-rat-plugin
should also be always ignored
I have a bunch of specfiles that do this kind of thing, because IMO these plug-ins are never relevant for RPM builds:
Can we automatically black-list these plug-ins so we don't have every specfile disabling the same stuff?