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 06EE210E84 for ; Sun, 16 Feb 2014 10:03:49 +0000 (UTC) Received: (qmail 67467 invoked by uid 500); 16 Feb 2014 10:03:45 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 67403 invoked by uid 500); 16 Feb 2014 10:03:44 -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 67395 invoked by uid 99); 16 Feb 2014 10:03:43 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Feb 2014 10:03:43 +0000 Received: from localhost (HELO robertscholte) (127.0.0.1) (smtp-auth username rfscholte, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Feb 2014 10:03:42 +0000 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "Maven Users List" Subject: Re: Maven deploy plugin 2.8.1 - deploy-file goal - unable to avoid attachedArtifacts from being deployed in execute References: Date: Sun, 16 Feb 2014 11:03:39 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Robert Scholte" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (Win32) Op Sun, 16 Feb 2014 08:15:25 +0100 schreef Henrik Skriver Rasmussen : > Thanks for the advice on how to restructure. > Could you have a look at the deploy-plugin project and the file > org.apache.maven.plugin.deploy.DeployFileMojo execute method line 376 in > version 2.8.1 ? I would really like to understand the following: > 1) What controls which artifacts are attached the model for the given > project? The plugin creating that artifact controls the attaching. For example: http://maven.apache.org/plugins/maven-source-plugin/xref/org/apache/maven/plugin/source/AbstractSourceJarMojo.html#307 Here the -sources.jar is attached to the project. > 2) Is it possible to state that no artifacts except explicitly stated > should be created/attached? The plugin creating that artifact > 3) Is it really the intended behaviour of the deploy:file goal to also > deploy the attached artifacts? To me that is a very non-intuitive > behaviour. Yes. If there are attachments created and these are attached, they are uploaded as well. So if you don't want this, solve it at the source, i.e the plugin creating the artifact. (for the maven-source-plugin: skip it (best option) or just don't attach (acceptable option) ) For the same reason you won't find "delete" options in any of the plugins. It is a matter of excluding the correct files. Robert > > I Basically have a working setup which deploys the zip file I generate to > repo with the name I have specified. But the only thing that bothers me > is > that for some unclear reason the same zip is deployed again with the name > of the project in the same deploy:file goal. To me - that is a bug. > Should I open an issue instead somewhere and provide the patch which > fixes > this?? > I already mailed the email listed in the top of the java file in question > but he does not reply. > > > > Med venlig hilsen > Henrik Skriver Rasmussen > > > On Thu, Feb 13, 2014 at 2:54 PM, Anders Hammar wrote: > >> You should really restart with the module 2 pom. >> >> Your multi-module structure is good. You have a separate projekt/module >> which creates your distro. What you should do is to create the "distro" >> (zip or whatever) to be created as part of the normal build and then >> deployed as the project's artifact it is. >> This is done in many projects and you could for example have a look at >> the >> Maven core project where we create a zip and a tar file. >> >> https://git-wip-us.apache.org/repos/asf?p=maven.git;a=tree;f=apache-maven;hb=HEAD >> >> So in the end, you will not use deploy:deploy-file. Also, your pom will >> be >> very small with pretty much only the m-assembly-p being bound to the >> build >> lifecycle. >> >> /Anders >> >> >> On Thu, Feb 13, 2014 at 11:36 AM, Henrik Skriver Rasmussen < >> skriver79@gmail.com> wrote: >> >> > Hi Anders >> > >> > I have a multi-module project with this structure: >> > >> > A (root and parent pom project) >> > - module 1 - builds a jar as artifact >> > - module 2 - uses module 1 jar artifact in assembly tries to deploy >> the >> > assembled zip file to artifactory. >> > >> > This is the module 2 pom file with YYYY inserted to replace project >> > specific names. >> > >> > > > >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> > >> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >> > http://maven.apache.org/xsd/maven-4.0.0.xsd"> >> > >> > 4.0.0 >> > >> > >> > >> > YYYY >> > >> > YYYY >> > >> > 1.1-SNAPSHOT >> > >> > >> > >> > scripts >> > >> > pom >> > >> > scripts >> > >> > YYYY >> > >> > >> > >> > UTF-8 >> > >> > >> UTF-8 >> > >> > ${project.parent.basedir} >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > org.apache.maven.plugins >> > >> > maven-install-plugin >> > >> > 2.5.1 >> > >> > >> > >> > true >> > >> > >> > >> > >> > >> > >> > >> > org.apache.maven.plugins >> > >> > maven-assembly-plugin >> > >> > 2.4 >> > >> > >> > >> > true >> > >> > >> > >> > >> > >> > >> > >> > org.apache.maven.plugins >> > >> > maven-deploy-plugin >> > >> > 2.8.1 >> > >> > >> > >> > true >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > deployprofile >> > >> > >> > >> > >> > >> > >> > >> > org.codehaus.mojo >> > >> > exec-maven-plugin >> > >> > 1.2.1 >> > >> > >> > >> > >> > >> > Copy into target folder and copy service jar into >> files/default >> > >> > >> > package >> > >> > >> > >> > exec >> > >> > >> > >> > >> > >> > ${project.basedir}/build_cookbook.sh >> > >> > >> > >> > ${project.parent.artifactId} >> > >> > ${project.parent.version} >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > org.apache.maven.plugins >> > >> > maven-assembly-plugin >> > >> > 2.4 >> > >> > >> > >> > >> > >> > deployprofile >> > >> > package >> > >> > >> > >> > single >> > >> > >> > >> > >> > >> > ${project.parent.artifactId}-${project.parent.version} >> > >> > >> > ${project.build.directory}/ >> > >> > true >> > >> > >> > >> > assembly/dist.xml >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > org.apache.maven.plugins >> > >> > maven-deploy-plugin >> > >> > >> > >> > >> > >> > cookbook >> > >> > deploy >> > >> > >> > >> > deploy-file >> > >> > >> > >> > >> > >> > false >> > >> > artifactory >> > >> > zip >> > >> > >> ${project.distributionManagement.snapshotRepository.url} >> > >> > false >> > >> > ${project.parent.artifactId} >> > >> > ${project.parent.groupId} >> > >> > ${project.parent.version} >> > >> > deploymentfile >> > >> > >> > >> > >> > >> > >> ${project.build.directory}/${project.parent.artifactId}-${project.parent.version}-deploymentfile.zip >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > Med venlig hilsen >> > Henrik Skriver Rasmussen >> > >> > >> > On Thu, Feb 13, 2014 at 2:15 PM, Anders Hammar >> wrote: >> > >> > > You need to provide more info on what you're doing! Is the >> > > deploy:deploy-file bound to the build lifecycle of a project? How? >> > > >> > > /Anders >> > > >> > > >> > > On Thu, Feb 13, 2014 at 11:06 AM, Henrik Skriver Rasmussen < >> > > skriver79@gmail.com> wrote: >> > > >> > > > Hi >> > > > >> > > > I have a question about the expected behaviour of the >> > deploy:deploy-file >> > > > goal in the maven deploy plugin 2.8.1 which I am currently using >> to >> > > deploy >> > > > one file. >> > > > >> > > > It surprised me that no matter what I did I kept getting more >> artifacts >> > > > deployed that I asked for and the reason is in the >> > > > org.apache.maven.plugin.deploy.DeployFileMojo.execute line 376 >> where >> > the >> > > > attached artifacts are also deployed. >> > > > >> > > > Is this intended behaviour and if so how can I avoid this from >> > happening? >> > > > >> > > > The goal name deploy-file indicates that one artifact (possible >> incl. >> > > > pom/metadata) is to be deployed and not also a throng of other >> > artifacts. >> > > > >> > > > I will be happy to provide a patch where this is aspect is >> removed. >> > > > >> > > > Thank you in advance >> > > > >> > > > regards >> > > > Henrik Skriver Rasmussen >> > > > >> > > >> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org