qoomon / maven-git-versioning-extension

This extension will set project version, based on current Git branch or tag.
GNU General Public License v3.0
303 stars 87 forks source link

Change the default location of .git-versioned.pom.xml to a folder inside target-folder #28

Closed florianli closed 5 years ago

florianli commented 5 years ago

The .git-versioned.pom.xml is always generated when maven build is executed. Therefore it should not be stored in git. In your current plugin-configuration the default folder of .git-versioned.pom.xml is currentProject.getBasedir(). I think, it is common for a maven-project, that generated files are stored inside the target-folder.

qoomon commented 5 years ago

That was my first implementation, then I found out that some maven plugins from apache acts this way. However I can revert this change an put it the target folder again.

florianli commented 5 years ago

I can remember that it worked that way in a previous version. #29 looks good to me.

qoomon commented 5 years ago

implemented in version v4.0.3

qoomon commented 5 years ago

@florianli I've just recognised that the official maven flatten plugin put its .flattened-pom.xml next to the original pom.xml as-well. We may should follow the standard? What do you think? actually it's quite easy to exclude all artificial pom.xml files git ignore patten would look like this .*-pom.xml

florianli commented 5 years ago

I don't have any opinion on this, except it should be inside the target-folder. I can have a look at the maven documentation tomorrow, if you want. Mayby I find something about this topic.

qoomon commented 5 years ago

that would be great

qoomon commented 5 years ago

I just found kinda explanation why they choose to place the modified pom file next to the original https://github.com/mojohaus/flatten-maven-plugin/issues/50 I also found out that that the flatten plugin has a clean goal that is registered to the clean phase. So I think I will revert the location back to next to the original pom file and a this clean task. What do you think?

florianli commented 5 years ago

I think I made my point quite clear with this issue. But in the end it is your desicion. When it is next to the original pom I will add a pattern to. gitignore to avoid that someone will commit the file to git

qoomon commented 5 years ago

@florianli I think the problem mentioned in mojohaus/flatten-maven-plugin#50 is fixed so I will leave the pom in the target directory.

yankydoo commented 3 years ago

It seems that starting with 6.0.0 the .git-versioned-pom.xml is generated next to the pom.xml again, not in the target directory. Was this an intentional change? If so, it would be great to add it to the changelog.

qoomon commented 3 years ago

It was intentional. I changed the location due to problems for some plugins with relative paths (relative to pom location). I'll add a changelog entry. I'm sorry for the inconvenience.

yankydoo commented 3 years ago

Don't worry, no big deal. Thanks for the response!

tylerbenson commented 2 years ago

I suggest it would be worth adding a setting for this. I agree with @yankydoo it would be nice to have it in target instead of the root. One reason is that when I'm doing find/replace operations, Intellij knows to exclude items in the target folder, but the git versioned pom shows up in those search results.

qoomon commented 2 years ago

There are related issues in the flatten pom plugin, see: