Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5B2F1880F for ; Fri, 11 Mar 2016 05:43:57 +0000 (UTC) Received: (qmail 26642 invoked by uid 500); 11 Mar 2016 05:43:56 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 26588 invoked by uid 500); 11 Mar 2016 05:43:56 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 26577 invoked by uid 99); 11 Mar 2016 05:43:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2016 05:43:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 895D2C6281 for ; Fri, 11 Mar 2016 05:43:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.799 X-Spam-Level: * X-Spam-Status: No, score=1.799 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id BaJ35k3N-csg for ; Fri, 11 Mar 2016 05:43:54 +0000 (UTC) Received: from mail.x-reizend.de (x-reizend.de [212.227.38.46]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTP id B127E5F1BE for ; Fri, 11 Mar 2016 05:43:53 +0000 (UTC) Received: from spaceship.fritz.box (dslb-188-110-241-029.188.110.pools.vodafone-ip.de [188.110.241.29]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.x-reizend.de (Postfix) with ESMTPSA id BF6AF11C0A6; Fri, 11 Mar 2016 05:43:45 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: Why isn't maven-dependency-plugin copying my artifacts anymore? From: Uwe Barthel In-Reply-To: Date: Fri, 11 Mar 2016 06:43:45 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <56E1F5C9.6000102@gmail.com> <56E1FBF0.5080102@yahoo.com> <56E201BF.9010100@gmail.com> <56E204E4.7090107@yahoo.com> <56E206F6.80407@gmail.com> <56E20936.7080003@yahoo.com> <56E20B50.5020308@gmail.com> To: Maven Users List X-Mailer: Apple Mail (2.3112) I tried: 'mvn clean' removes the lib/ and target/ folder. 'mvn package' puts the libs into lib/ again. I delete all libs in lib/ folder but let the lib/ folder itself and the = target folder untouched. =E2=80=98mvn package=E2=80=99 works as expected. --=20 barthel@x-reizend.de > On 11 Mar 2016, at 06:05, David Karr = wrote: >=20 > Ok. Could you remove the jars and then run it again? >=20 > On Thu, Mar 10, 2016, 20:58 Uwe Barthel wrote: >=20 >> Hi David, >>=20 >> I use your pom.xml (but removed parent and org.opendaylight = dependencies) >> and it works well with: >>=20 >> Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; >> 2015-11-10T17:41:47+01:00) >> Maven home: /usr/local/Cellar/maven/3.3.9/libexec >> Java version: 1.8.0_31, vendor: Oracle Corporation >> Java home: >> /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre >> Default locale: en_US, platform encoding: UTF-8 >> OS name: "mac os x", version: "10.11.3", arch: "x86_64", family: = =E2=80=9Cmac" >>=20 >> $ ls -1 libs/ >> antlr4-runtime-4.0.jar >> mapdb-1.0.4.jar >>=20 >> -- >> barthel@x-reizend.de >>=20 >>=20 >>> On 11 Mar 2016, at 01:03, David M. Karr >> wrote: >>>=20 >>> On 03/10/2016 03:54 PM, Mark Eggers wrote: >>>> David, >>>>=20 >>>> I just upgraded to 3.3.9, and ran the following on one of my = projects >>>> (twice): >>>>=20 >>>> mvn clean package >>>>=20 >>>> In both cases the JAR files were copied to my output directory and >>>> included in both the zip and tar.gz files. >>>>=20 >>>> I guess a little more information is needed?? >>>=20 >>> Ok. Following this is the entire pom.xml file in question. Two of = the >> artifacts aren't on MavenCentral, but the example could easily be >> simplified to not specify those. >>>=20 >>> ------------------------------ >>> > http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D" >> http://maven.apache.org/POM/4.0.0 >> http://maven.apache.org/xsd/maven-4.0.0.xsd"> >>> 4.0.0 >>>=20 >>> >>> com.cisco.yangide >>> com.cisco.yangide.parent >>> 1.1.1-SNAPSHOT >>> ../.. >>> >>>=20 >>> com.cisco.yangide.core >>> eclipse-plugin >>> 1.1.1-SNAPSHOT >>> >>> src >>> >>> >>> org.apache.maven.plugins >>> maven-clean-plugin >>> >>> >>> >>> libs >>> >>> >>> >>> >>> >>> org.apache.maven.plugins >>> maven-dependency-plugin >>> 2.10 >>> >>> >>> copy >>> prepare-package >>> >>> copy >>> >>> >>> libs >>> >>> >>> org.antlr >>> antlr4-runtime >>> 4.0 >>> jar >>> true >>> antlr4-runtime-4.0.jar >>> >>> >>> org.mapdb >>> mapdb >>> 1.0.4 >>> jar >>> true >>> mapdb-1.0.4.jar >>> >>> >>> org.opendaylight.yangtools >>> yang-model-api >>> 0.6.1 >>> jar >>> true >>> yang-model-api-0.6.1.jar >>> >>> >>> org.opendaylight.yangtools >>> yang-parser-impl >>> 0.6.1 >>> jar >>> true >>> yang-parser-impl-0.6.1.jar >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> ---------------------- >>>>=20 >>>> . . . just my two cents >>>> /mde/ >>>>=20 >>>> On 3/10/2016 3:44 PM, David M. Karr wrote: >>>>> On 03/10/2016 03:36 PM, Mark Eggers wrote: >>>>>> David, >>>>>>=20 >>>>>> If you're providing a list of dependencies, then yes you'll use = the >> copy >>>>>> instead of copy-dependencies. >>>>>>=20 >>>>>> See the following for that information: >>>>>>=20 >>>>>> = https://maven.apache.org/plugins/maven-dependency-plugin/index.html >>>>>>=20 >>>>>> Also, I notice that you don't have outputDirectory specified. If = you >>>>>> don't, the dependencies will be copied to >>>>>> ${project.build.directory}/dependency. >>>>> Actually, I was specifying that individually on each artifactItem, = but >>>>> it's definitely an improvement to only specify that once. In any = case, >>>>> it still makes no difference. It's not writing the artifacts, = whether >> I >>>>> use "copy" or "copy-dependencies", or whether I say to write them = to >>>>> "libs" or "${project.build.directory}/libs". It ("copy", to be >> specific) >>>>> did it the first time I ran this, but never since then. >>>>>=20 >>>>> I'm using Maven 3.3.9, with JDK 1.8.0_60. >>>>>=20 >>>>>> See the following for that information: >>>>>>=20 >>>>>>=20 >> = https://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html >>>>>>=20 >>>>>> . . . just my two cents >>>>>> /mde/ >>>>>>=20 >>>>>> On 3/10/2016 3:22 PM, David M. Karr wrote: >>>>>>> Thanks, but replacing my "manual" copy goal with = "copy-dependencies" >> and >>>>>>> implicit dependency declarations made no difference. No error = at >> this >>>>>>> phase, it just doesn't do anything. >>>>>>>=20 >>>>>>> On 03/10/2016 02:57 PM, Mark Eggers wrote: >>>>>>>> David, >>>>>>>>=20 >>>>>>>> On 3/10/2016 2:31 PM, David M. Karr wrote: >>>>>>>>> Several days ago, on the advice of someone on another list, I >>>>>>>>> configured >>>>>>>>> the use of the "maven-dependency-plugin" in my POM so that the >> build >>>>>>>>> would copy some dependencies into a local folder, not inside = the >>>>>>>>> target >>>>>>>>> folder. >>>>>>>>>=20 >>>>>>>>> This worked the very first time I ran the build with it, and = I've >> been >>>>>>>>> using the results for a while. >>>>>>>>>=20 >>>>>>>>> Today I started to look at this again, to ensure that these = copied >>>>>>>>> artifacts would be properly cleaned up from "mvn clean". I = first >>>>>>>>> tried >>>>>>>>> reconfiguring where it wrote the jars, changing it from "libs" = to >>>>>>>>> "target/libs". For some reason, when I ran the build, it = didn't >>>>>>>>> create >>>>>>>>> "target/libs", nor did it copy the jars. At that point, I = thought >>>>>>>>> there >>>>>>>>> was some issue with writing them into a subfolder of "target". >>>>>>>>>=20 >>>>>>>>> I then changed it back to "libs", but I implemented additional >>>>>>>>> "maven-clean-plugin" configuration to make it delete that = folder. >>>>>>>>> When I >>>>>>>>> ran "mvn clean", it did what I expected, removing that folder, >> along >>>>>>>>> with "target". >>>>>>>>>=20 >>>>>>>>> However, when I then tried to build the whole thing again, I = found >>>>>>>>> that >>>>>>>>> it wasn't creating the "libs" folder, and it wasn't copying = the >> jars >>>>>>>>> there. I then tried manually creating "libs", but that didn't >>>>>>>>> help. I >>>>>>>>> tried adding "--debug", which didn't tell me anything useful. = I >>>>>>>>> imagine >>>>>>>>> the same thing that is making it not copy the jars into "libs" = is >> the >>>>>>>>> same thing that prevented it writing them into "target/libs", = so >> there >>>>>>>>> likely wasn't a real issue with using a subfolder of "target", = but >>>>>>>>> something else is just preventing it from copying the jars. >>>>>>>>>=20 >>>>>>>>> This is what I have in the POM for this plugin (eliding the >> details of >>>>>>>>> each artifact): >>>>>>>>> ----------------- >>>>>>>>> >>>>>>>>> org.apache.maven.plugins >>>>>>>>> maven-dependency-plugin >>>>>>>>> 2.10 >>>>>>>>> >>>>>>>>> >>>>>>>>> copy >>>>>>>>> package >>>>>>>>> >>>>>>>>> copy >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> ... >>>>>>>>> >>>>>>>>> >>>>>>>>> ... >>>>>>>>> >>>>>>>>> >>>>>>>>> ... >>>>>>>>> >>>>>>>>> >>>>>>>>> ... >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> ------------------- >>>>>>>> My copy looks like this: >>>>>>>>=20 >>>>>>>> >>>>>>>> org.apache.maven.plugins >>>>>>>> maven-dependency-plugin >>>>>>>> 2.10 >>>>>>>> >>>>>>>> >>>>>>>> prepare-package >>>>>>>> >>>>>>>> copy-dependencies >>>>>>>> >>>>>>>> >>>>>>>>=20 >> ${project.build.directory}/lib >>>>>>>> compile >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>=20 >>>>>>>> I'm currently running 3.3.3 and JDK 1.8.0_74. I need to upgrade = my >>>>>>>> Maven. >>>>>>>>=20 >>>>>>>> This works as expected, with dependencies getting copied to >> target/lib. >>>>>>>>=20 >>>>>>>> I have this in my JAR plugin: >>>>>>>>=20 >>>>>>>> true >>>>>>>> lib/ >>>>>>>>=20 >>>>>>>> along with specifying the main class. >>>>>>>>=20 >>>>>>>> I create both a zip and a tar.gz file with the assembly plugin. >>>>>>>>=20 >>>>>>>> An end user just unpacks the archive, changes to the directory = where >>>>>>>> the >>>>>>>> archive was unpacked, and runs java -jar ${artifactId}.jar. >>>>>>>>=20 >>>>>>>> Seems to work reasonably well. >>>>>>>>=20 >>>>>>>> . . . just my two cents >>>>>>>> /mde/ >>>>=20 >>>=20 >>>=20 >>> = --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org >>> For additional commands, e-mail: users-help@maven.apache.org >>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org >> For additional commands, e-mail: users-help@maven.apache.org >>=20 >>=20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org