Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should I put in the target directory?

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).

like image 510
sab Avatar asked Mar 28 '16 10:03

sab


People also ask

What is the target directory?

The destination directory/folder to which files are sent.

What does target folder contain?

A folder, hardcopy or electronic, containing target intelligence and related materials prepared for planning and executing action against a specific target. See also target.

What is target folder in Maven?

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.

Where is Maven target folder?

The maven targets are located in your project config/ folder.


1 Answers

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.

like image 82
Tunaki Avatar answered Oct 21 '22 00:10

Tunaki