You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@apache.org> on 2018/06/13 20:36:00 UTC

[jira] [Commented] (MDEP-620) mvn dependency:unpack via CLI generates ${project.basedir} folder

    [ https://issues.apache.org/jira/browse/MDEP-620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16511632#comment-16511632 ] 

Michael Osipov commented on MDEP-620:
-------------------------------------

Cannot reproduce:

{noformat}
PS D:\Entwicklung\workspace-4.5\michael-o-parent> mvn -V dependency:unpack "-Dartifact=org.apache.maven:maven-core:3.5.3
:jar" -DoutputDirectory=toll
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Maven home: D:\Entwicklung\Programme\apache-maven-3.5.3\bin\..
Java version: 1.8.0_172, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_172\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< net.sf.michael-o:michael-o-parent >------------------
[INFO] Building Michael Osipov's SourceForge.net Parent POM 10
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.0.0:unpack (default-cli) @ michael-o-parent ---
[INFO] Configured Artifact: org.apache.maven:maven-core:3.5.3:jar
[INFO] Unpacking C:\Users\mosipov\.m2\repository\org\apache\maven\maven-core\3.5.3\maven-core-3.5.3.jar to D:\Entwicklung\workspace-4.5\michael-o-parent\toll with includes "" and excludes ""
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.268 s
[INFO] Finished at: 2018-06-13T22:34:45+02:00
[INFO] ------------------------------------------------------------------------
PS D:\Entwicklung\workspace-4.5\michael-o-parent> ls


    Verzeichnis: D:\Entwicklung\workspace-4.5\michael-o-parent


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       2016-01-22     23:27                .settings
d-----       2016-01-22     23:27                src
d-----       2018-06-13     22:34                target
d-----       2018-06-13     22:34                toll
-a----       2013-03-27     21:27            396 .project
-a----       2013-03-27     21:27          11560 LICENSE.txt
-a----       2017-03-03     22:37          13601 pom.xml
{noformat}

> mvn dependency:unpack via CLI generates ${project.basedir} folder
> -----------------------------------------------------------------
>
>                 Key: MDEP-620
>                 URL: https://issues.apache.org/jira/browse/MDEP-620
>             Project: Maven Dependency Plugin
>          Issue Type: Bug
>          Components: unpack
>         Environment: * Maven 3.5.3
> * CLI
> * macOS and CentOS
>            Reporter: Dimitri R
>            Priority: Major
>
> h3. Steps to reproduce
> 1. Get a sample dependency first
> {noformat}
> mvn dependency:get -DgroupId=org.apache.ant -DartifactId=ant -Dversion=1.8.3 -Dpackaging=jar
> {noformat}
> 2. Delete the file *~/.m2/repository/org/apache/ant/ant/1.8.3/_remote.repositories*
>  3. Unpack the dependency somewhere
> {noformat}
> cd /tmp
> mkdir unpack
> mvn dependency:unpack -Dartifact=org.apache.ant:ant:1.8.3:jar -DoutputDirectory=./unpack
> {noformat}
> 4. Observe that *${project.basedir}* was created
> {noformat}
> $ ls -l /tmp/unpack
> total 0
> ... ${project.basedir}
> ... unpack
> {noformat}
> *_Note_* Step 2 is only necessary because of _getting_ the dependency, this wouldn't have to be done if it had been _installed_. This doesn't affect whether the bug occurs or not.
> h3. Workarounds
> The closest would be to use {{mvn dependency:copy}} and _then_ unpack manually through a subsequent command. Interestingly this shows that the bug doesn't affect {{mvn dependency:copy}}.
> ----
> Similar/related issues (their fixes don't apply here):
>  - [https://stackoverflow.com/q/11669446/321797]
>  - [https://netbeans.org/bugzilla/show_bug.cgi?id=221560]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)