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 D31709214 for ; Fri, 19 Dec 2014 10:18:27 +0000 (UTC) Received: (qmail 65659 invoked by uid 500); 19 Dec 2014 10:18:22 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 65491 invoked by uid 500); 19 Dec 2014 10:18:22 -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 65117 invoked by uid 99); 19 Dec 2014 10:18:22 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Dec 2014 10:18:22 +0000 Received: from robertscholte.dynamic.ziggo.nl (5248749D.cm-4-1b.dynamic.ziggo.nl [82.72.116.157]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 0F3D41A0041 for ; Fri, 19 Dec 2014 10:18:20 +0000 (UTC) Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "Maven Users List" Subject: Re: Creating a jar and a war from a war project References: Date: Fri, 19 Dec 2014 11:18:14 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Robert Scholte" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.17 (Win32) Re-reading your request... bq. Jar - This should contain all the class files and dependencies of war project. However dependencies should be copied under lib folder of this jar and should not be in unpacked form. I hope you are aware that this conflicts with the jar-specs. The classes inside the lib/*.jars won't end up on the classpath, which makes this jar useless. I'd strongly advice you not to solve it as you described. thanks, Robert Op Fri, 19 Dec 2014 10:33:19 +0100 schreef shailendra singh : > Hi, > > Thank you for your response. > > I am already aware about these two parameters. > > I don't thing 'archiveClasses' parameter will be of any help in my case. > > I had tried to use 'attachClasses' initially but I could not figure out > how to pull war dependencies (and that too in a lib folder) in the jar > file which will be generated by setting this parameter to true. > > So I have no solution for my problem yet. > > Thanks > Shailendra > >> To: users@maven.apache.org >> Subject: Re: Creating a jar and a war from a war project >> Date: Fri, 19 Dec 2014 09:54:58 +0100 >> From: rfscholte@apache.org >> >> Hi, >> >> have a look at the following parameters of the manve-war plugin: >> - archiveClasses[1] >> - attachClasses[2] >> >> I suggest *not* to use the maven-assembly-plugin in this case. It'll >> make >> things over-complex. >> >> thanks, >> Robert >> >> [1] >> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#archiveClasses >> [2] >> http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#attachClasses >> >> >> Op Fri, 19 Dec 2014 08:03:22 +0100 schreef shailendra singh >> : >> >> > Hi, >> > >> > For some reason I am struggling to >> > create a war and a jar from a maven war project. I want to create >> these >> > two artifacts from my maven war project with following requirements - >> > >> > Jar >> > - This should contain all the class files and dependencies of war >> > project. However dependencies should be copied under lib folder of >> this >> > jar and should not be in unpacked form. This part is giving me >> problem. >> > >> > War >> > - For war I simply want to have static artifacts and nothing which is >> > present under WEB-INF folder. I am able to achieve this using maven >> war >> > plugin. >> > >> > Here is the code present under tag of my pom.xml - >> > >> > >> > >> > maven-compiler-plugin >> > >> > 1.8 >> > 1.8 >> > >> > >> > >> > maven-assembly-plugin >> > >> > >> > assembly.xml >> > >> > false >> > >> > >> > true >> > lib/ >> > >> > >> > >> > >> > >> > jar-with-dependencies-in-lib >> > package >> > >> > single >> > >> > >> > >> > >> > >> > maven-war-plugin >> > >> > WEB-INF/ >> > false >> > >> > >> > >> > >> > >> > >> > Here is content of assembly.xml file which is located directly under >> > project root directory - >> > >> > > > >> xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> > >> xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 >> > http://maven.apache.org/xsd/assembly-1.1.2.xsd"> >> > jar-with-dependencies-in-lib >> > >> > jar >> > >> > false >> > >> > >> > >> target/${project.artifactId}-${project.version}/WEB-INF/lib >> > >> > >> target/${project.artifactId}-${project.version}/WEB-INF/classes >> > >> > >> > >> > >> > >> > I >> > feel that I don't need maven-war-plugin at all and both the artifacts >> > can be created using maven assembly plugin only. However I am unable >> to >> > figure out how to achieve this. >> > >> > - Shailendra >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org >> For additional commands, e-mail: users-help@maven.apache.org >> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org