I'm making a Maven plugin. I use another library that downloads files and put them in a directory if they don't exist, of if they are too old, then my code use the files.
I don't want this file by commit by mistake by the devs using my plugin.
Is that a good practice to put this "temporary" files in the target directory?
Some other plugin create their own "target-custom" to do it (for example grunt-maven-plugin
create a target-grunt
directory).
The destination directory/folder to which files are sent.
A folder, hardcopy or electronic, containing target intelligence and related materials prepared for planning and executing action against a specific target. See also target.
The target directory is used to house all output of the build. The src directory contains all of the source material for building the project, its site and so on. It contains a subdirectory for each type: main for the main build artifact, test for the unit test code and resources, site and so on.
The maven targets are located in your project config/ folder.
Yes! I would even go furthen than to say it's a good practice. I would say you have to generate those files inside the target
folder.
target
is the Maven build directory, which means that all generated content should be placed under that folder. As you said in your question, this folder should be typically ignored by your VCS (svn ignore
or .gitignore
) because it is a temporary directory that can be deleted at any time.
So to put it simply: place your temporary content under target/{name-of-your-plugin}
; this makes it clear that this subfolder is your temporary folder and it doesn't create unnecessary temp folders.
For the side-note, I don't know why the grunt-maven-plugin
has a special target-grunt
temporary directory but I'll note that from the GitHub home page, the plugin is discontinued and this was configurable through the gruntBuildDirectory
attribute.
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