Skip to content

[MDEP-651] - allow unpack dependency to configure entries overwrite #13

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

Closed
wants to merge 2 commits into from
Closed

[MDEP-651] - allow unpack dependency to configure entries overwrite #13

wants to merge 2 commits into from

Conversation

viqueen
Copy link

@viqueen viqueen commented Apr 27, 2019

https://issues.apache.org/jira/browse/MDEP-651

Extending unpack-dependencies with an option to not overwrite archive entries with duplicate names. The latter can be problematic on case insensitive file systems.

From what I can tell, we always overwrite when unarchiving artifacts , therefore maintaining that to be the default behaviour.

This change will also require the following updates to plexus-archiver codehaus-plexus/plexus-archiver#112

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MDEP-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MDEP-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@@ -86,7 +86,7 @@
* @since 3.1.2
*/
@Parameter( property = "mdep.unpack.overwrite", defaultValue = "true" )
private boolean overwrite;
private boolean overwrite = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already don via the defaultValue from the annotation above.

@khmarbaise
Copy link
Member

It would be great having a unit/integration tests to check the behaviour...

@hazendaz
Copy link
Contributor

need this one badly. Recent plexus archivers fail hard so we have to use 4.2.2 so that it does not. even without tests its a problem currently if overwrite as documented all over doesn't actually work. what can we do to get this going?

@hazendaz
Copy link
Contributor

see https://maven.apache.org/plugins/maven-dependency-plugin/usage.html, the documentation as is states this works, this shows that it does not, proven does not.

plexus archiver 4.2.2 simply states [WARNING] Unable to expand to file .... when it has issue. All newer including 4.7.1 of plexus archiver blow up as file is open (ie windows).

@hazendaz
Copy link
Contributor

ok guess this may be different issue. and much worse. 'unpack' isn't respecting this. 'unpack-dependencies' didn't have it. willing to fix here but I doubt this even works. Its simply to test. I unzip chrome to .m2 and then open a copy, crashes everytime as indicated with newer plexus archiver but was a warning previously but really don't want it to re-extract anything.

@viqueen viqueen closed this by deleting the head repository May 25, 2023
@hazendaz
Copy link
Contributor

hazendaz commented Jun 3, 2024

Adding a comment here to old comments I made. The issue turned out to be the marker file location used by the dependency plugin. Its default sits in target so 'clean' wipes that every time. Moving that to m2 location instead resolved the issue for us where we share a live cache for running jenkins jobs on same boxes. So we no longer get the behaviour we were seeing at that time and nothing needed to change other than moving where the marker directory was located.

See https://maven.apache.org/plugins/maven-dependency-plugin/unpack-mojo.html#markersDirectory

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.

3 participants