Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.java > #8629

Re: maven-debian-helper=2.0~exp2 rebuild

Path csiph.com!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Andrew Schurman <arcticwaters@gmail.com>
Newsgroups linux.debian.maint.java
Subject Re: maven-debian-helper=2.0~exp2 rebuild
Date Wed, 02 Dec 2015 23:00:03 +0100
Message-ID <qBnBp-4pb-35@gated-at.bofh.it> (permalink)
References <qyQzU-3OH-9@gated-at.bofh.it> <qznYS-18E-3@gated-at.bofh.it> <qBaXw-4EG-19@gated-at.bofh.it> <qBbqx-4Qy-1@gated-at.bofh.it>
X-Original-To Emmanuel Bourg <ebourg@apache.org>, debian-java@lists.debian.org
X-Mailbox-Line From debian-java-request@lists.debian.org Wed Dec 2 21:54:26 2015
Old-Return-Path <arcticwaters@gmail.com>
X-Amavis-Spam-Status No, score=-11.599 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, LDO_WHITELIST=-5, MDO_CABLE_TV3=0.5, PGPSIGNATURE=-5] autolearn=ham autolearn_force=no
X-Policyd-Weight NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-pf0-x22e.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:in-reply-to:references:content-type :mime-version; bh=geOQPAtsaS+WvUpHFCubESr8DcZPDyz+qeIM9pWRQlY=; b=OWdut4LWD/8G9YNBl8cePRztvMDdJXqosDWoUPvqvLDzl2h8Nl1No6qX36pXB6+Btb J73rOU/sANPfpddNFBKq15xoHLjUCf4HzoDSp2BqvcfZQntUdpFUJ5tpfP+5qd+x16+h A2K3iJMQu+lByXWHxZ332A4EyFHXMiGrb1V9d2v1KqrRq+8ice5/e1CZTuPnk/DH+EDb QqyFs9hFwSk67sQ+GQmbVH79POHtR3rmQzKEgNXB2eWP1R7DB3GxVfgswu+08jXnzDjq f6eWnoexBDnoYpEqX5uBE5jLphsZRS4QCj8ii0ZlwdP2nq6nzgI9FzuFoQZa+qjFtRMj ARpQ==
X-Received by 10.98.7.193 with SMTP id 62mr8196923pfh.22.1449093249039; Wed, 02 Dec 2015 13:54:09 -0800 (PST)
Content-Type multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-fpbspGKAQ2ZT7uZgOPAH"
X-Mailer Evolution 3.16.5-1
MIME-Version 1.0
X-Mailing-List <debian-java@lists.debian.org> archive/latest/18948
List-ID <debian-java.lists.debian.org>
List-URL <https://lists.debian.org/debian-java/>
List-Archive https://lists.debian.org/msgid-search/1449093241.8488.43.camel@gmail.com
Approved robomod@news.nic.it
Lines 138
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Wed, 02 Dec 2015 13:54:01 -0800
X-Original-Message-ID <1449093241.8488.43.camel@gmail.com>
X-Original-References <20151125220927.GA20309@blind.goeswhere.com> <565827C2.9000507@apache.org> <1449044757.28779.12.camel@gmail.com> <565EB2B7.2050309@apache.org>
Xref csiph.com linux.debian.maint.java:8629

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Wed, 2015-12-02 at 09:58 +0100, Emmanuel Bourg wrote:
> > I think this comes back to our conversation about Maven 3 searching
> > for
> > that metadata file unless a version is explicit specified.
> 
> So if I understand well:
> 
> 1. the plugin defines the sequence of goals executed for each phase.
> The
> goals are specified with groupId:artifactId:goal(:version)?

Almost. It's the same format that is used on the command-line, although
I'm not sure if the shorthand works (i.e. dependency:copy):
groupId:artifactId[:version]:goal. See [1] for the defaults.

> 
> 2. if the version of a goal is specified, Maven doesn't check if the
> plugin is installed until the actual execution of the phase.
> 
> 3. if the version of a goal isn't specified, Maven attempts to
> resolve
> the version by reading the metadata file in the local repository.
> This
> happens during the initialization of the plugin, even if the phase
> isn't
> executed. Failing to resolve the version triggers an error.
> 
> Is this correct?

Yup. That's my understanding as well. A more thorough breakdown below:

Maven first builds a model to in order to create an execution plan. At
this point only plugin versions in the pom are resolved (see plugins in
the effective-pom). As it creates this execution plan, plugins from the
lifecycle mapping [1] are injected into the model and versions are
resolved again before finally running the execution plan. Physical
plugin jars appear to be resolved just before executing a goal.

Anytime you see resolve versions above, either (1) there is an explicit
version specified, (2) it is resolved from a parent or the superpom
through plugin/plugin management, or (3) resolved first from maven
-metadata.xml in the local repo (ignoring whether a jar file is present
or not), or through any other online repositories defined (these aren't
applicable since we build in offline mode). If a version cannot be
found, it dies as you have found.

Notice that when resolving versions, you don't need the metadata if you
specify a version explicitly (as the default jar packaging does) and
therefore don't need the plugin in the local repo at all (unless you
actually want to run that plugins goal).

> 
> In this case generating the metadata automatically doesn't help,
> because
> for now it covers only the plugins already installed. We would need
> metadata for plugins not installed to work around this issue.
> 
> 
> > Looking at maven-bundle-plugin:2.4.0, none of the goals specify a
> > version (the default ones defined in maven-core do). Curious that
> > the
> > install plugin is the only one complaining...
> 
> Actually I noticed similar errors with the deploy plugin, I guess it
> came from the bundle plugin as well since it declares:
> 
>   <deploy>
>     org.apache.maven.plugins:maven-deploy-plugin:deploy,
>     org.apache.felix:maven-bundle-plugin:deploy
>   </deploy>
> 
> I added a dependency on maven-deploy-plugin to work around this
> issue.

Yup. The bundle plugin lifecycle mapping overwrites the default one.
Since the clean/site mappings aren't touched, they are inherited from
jar.

> 
> 
> > If we can get away with just installing the plugin rather than
> > generating metadata, so much the better. Just keep this in mind as
> > you
> > may run into it again for another project type.
> 
> At this point I'm wondering if I should move the dependency on the
> install plugin from maven-debian-helper to the bundle plugin. That
> would
> be a more accurate dependency chain, but on the other hand the
> install
> plugin is often used, so having it by default with maven-debian
> -helper
> is maybe a good thing.
> 

I don't know if adding a dependency will actually fix this based on the
resolution logic above. At least, not without metadata. But defining a
dependency on the maven-bundle-plugin makes more sense to me.

Two other options, although not as clean as the metadata approach:

1) Modify maven-core with a custom super pom with defining the install
-plugin version that we use. Unfortunately, this can be overridden...

2) Modify the bundle plugin to explicitly specify a version in the
lifecycle mappings.

Andrew

Back to linux.debian.maint.java | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

maven-debian-helper=2.0~exp2 rebuild Chris West <solo-debian-java@goeswhere.com> - 2015-11-25 23:20 +0100
  Re: maven-debian-helper=2.0~exp2 rebuild Emmanuel Bourg <ebourg@apache.org> - 2015-11-27 11:00 +0100
    Re: maven-debian-helper=2.0~exp2 rebuild Andrew Schurman <arcticwaters@gmail.com> - 2015-12-02 09:30 +0100
      Re: maven-debian-helper=2.0~exp2 rebuild Emmanuel Bourg <ebourg@apache.org> - 2015-12-02 10:00 +0100
        Re: maven-debian-helper=2.0~exp2 rebuild Andrew Schurman <arcticwaters@gmail.com> - 2015-12-02 23:00 +0100
          Re: maven-debian-helper=2.0~exp2 rebuild Emmanuel Bourg <ebourg@apache.org> - 2015-12-09 09:40 +0100

csiph-web