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

added support for basic file filtering when adding an explicit file #44

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

fracpete
Copy link

@fracpete fracpete commented Oct 4, 2019

  • similar to the file filtering in the debian-maven-plugin plugin (BeanUtils, FilterUtils classes stem from that project)
  • filtering gets activated for a file with the <filterFile>true</filterFile> tag
  • the filtering replaces ${varname} variables with the actual values
  • creates a tmp file with the expanded content, which gets deleted when the JVM exits
  • offers access to project variables, like project.name (see src/site/markdown/entry.md)
  • the following, additional variables are available:
    description
    distribution
    group
    packageName
    packager
    sourcePackage
    vendor
    version
    
  • this allows having centralized script templates used by multi-module projects, with directories/etc being represented by variables and then expanded at build time, rather than duplicating the scripts

@ctron
Copy link
Owner

ctron commented Oct 28, 2019

Sorry that this one has slipped my attention!

I don't really understand the reason for this PR though. Couldn't you simply use the maven filtering and then scoop the files with the RPM plugin?

@fracpete
Copy link
Author

No worries, we're all busy. ;-)
The default resource filtering with Maven works fine with scripts that are part of the same module. However, when using the dependency plugin to unpack a dependency containing scripts (I reuse the same scripts with placeholders for a bunch of projects), then filtering seems to be impossible (at least, I haven't found a way). Hence the direct support for file-filtering as part of the entries. If you're still keen on including this functionality, then I'll close this PR and create a new one, since I've moved out the file-filtering into its own library. I use the same functionality in my forked plugin for generating debian packages.

@ctron
Copy link
Owner

ctron commented Oct 28, 2019

So why don't you just use https://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html instead?

I am not really fond of adding another dependency. Having a re-implementation of the filtering is also not really what I would like to see. I am also not sure about the license of that library. The source code says GPL, the project license APLv2.

@fracpete
Copy link
Author

Most of my projects are GPLv3, hence I set up my IDE to automatically add the GPL preamble. I've fixed this. Thanks for pointing this out!
I will try to create minimal maven projects to see whether a combination of dependency-plugin/unpack-dependencies and maven-resources/copy-resources can be used to achieve the same result and will update on this.

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