Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ADBC4200B36 for ; Wed, 6 Jul 2016 12:51:17 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AC51C160A64; Wed, 6 Jul 2016 10:51:17 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CD2B7160A36 for ; Wed, 6 Jul 2016 12:51:16 +0200 (CEST) Received: (qmail 8209 invoked by uid 500); 6 Jul 2016 10:51:15 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 8193 invoked by uid 99); 6 Jul 2016 10:51:15 -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; Wed, 06 Jul 2016 10:51:15 +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 207A9C2981 for ; Wed, 6 Jul 2016 10:51:15 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.198 X-Spam-Level: * X-Spam-Status: No, score=1.198 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 tg6G04qrbBwG for ; Wed, 6 Jul 2016 10:51:12 +0000 (UTC) Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 7ED225F2C2 for ; Wed, 6 Jul 2016 10:51:11 +0000 (UTC) Received: by mail-qk0-f171.google.com with SMTP id 82so6120622qko.3 for ; Wed, 06 Jul 2016 03:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=4Z4nTvPWXVy6es3vT3wJMosB4IpVUKYOCXOwf9UULG8=; b=uqwN0Xo19xDAIWb6OsLi+kWSEoL1KQe+tS4+cw9UH8bUzX+Az1vrSpPJri38xL+HN7 9yTIBZ6PV4tPj0Eu28JPBzypVf56CsItRC3X64IIA2nfeGclDEbCrH5hZ9z7JWacCaHo Ix8uSYVjJoBONJx5XVfs/Z1mAxwerdJslWJxtffrZS7P3uUmC+4psCzt78K2PN2pCleU Vvs/mchFYybjfbxr+CCnxk0B7yJNWQSRdS8mBnASd/ijLgua5F9yLJqGzPpwO1dyYQuf IMzVzhhGJCeYur+GNV/mB2zrEA5c8R/+peKth7zJ5aLg9eQvXJOQ1GPo8bV9yj9HFGQB GmBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4Z4nTvPWXVy6es3vT3wJMosB4IpVUKYOCXOwf9UULG8=; b=kB97d21QIIOGeBnqIGjPHSCBOBqn3jhXQHEfzKcFwfEeHlUiXRUdeTUWHbMMeALK3y SulgT9b4Es7ufNu/huFhPxu8Q8WBS1xeLPsB2eXH8UoxP7whbTsDIyiU0BfycvcsTto/ Vz4mfPRNNTyFOkf08Z6ryFMhmuPM+h38+SnKvcV10kZpn+u9ap1mtHLMiTHfwVqoLyin Kj25GImm0DfVxj4Xx3OZxbNWaFSGsfkaBMsPXgSM825kKgpTkXrCJzH/s98urctcfMY4 pI0elvNOA1iro63kikaLQ6zPNHE6PrcjQjUwYd0Pj/a6yVaSagsgLGFUXopISXh2TzDe Z6dQ== X-Gm-Message-State: ALyK8tKoUbRv4L8bpClnyg9ZrGZ+HzXKGSnM/CqyOUhaFXBTPyuZhmihZhkn/E0hf9UJxC5gx3Raox+Ablhmgg== X-Received: by 10.55.131.196 with SMTP id f187mr31202611qkd.54.1467802270554; Wed, 06 Jul 2016 03:51:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.43.231 with HTTP; Wed, 6 Jul 2016 03:51:10 -0700 (PDT) From: =?UTF-8?Q?Lennart_J=C3=B6relid?= Date: Wed, 6 Jul 2016 12:51:10 +0200 Message-ID: Subject: Why would getDependencies() not return all plugin dependencies? To: Maven Developers List Content-Type: multipart/alternative; boundary=94eb2c070192efe0850536f558dd archived-at: Wed, 06 Jul 2016 10:51:17 -0000 --94eb2c070192efe0850536f558dd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello all, I am a tad puzzled here. I got a strange exception from the maven-checkstyle-plugin during its site generation yesterday. The immediate reason in the code was rather simple to track and fix (it is done in PR https://github.com/apache/maven-plugins/pull/88). I also created a discussion at https://issues.apache.org/jira/browse/MCHECKSTYLE-287. However - the root cause of this is not clear to me. It seems that the call to getArtifactMap().get( groupId:artifactId ) returns null - for some, but not all, artifacts. So my question is ... why would the call to *plugin.getDependencies()* not include some of the dependencies added to the plugin? Log output (I changed the last part of the log statement since this was captured, but the effect is still the same): [DEBUG] Generating /Users/lj/Development/Projects/Skolverket/Repos/framework/persistence/persi= stence-spi-jpa/target/site/checkstyle.html [INFO] Generating "Checkstyle" report --- maven-checkstyle-plugin:2.18-SNAPSHOT:checkstyle*[DEBUG] Got null CheckstylePlugin Dependency Artifact from key [se.foo:foo-codestyle]. Not including null Artifact. [DEBUG] Got null CheckstylePlugin Dependency Artifact from key [se.jguru.nazgul.tools.codestyle:nazgul-codestyle]. Not including null Artifact. [DEBUG] Got null CheckstylePlugin Dependency Artifact from key [se.foo:foo-codestyle]. Not including null Artifact. [DEBUG] Got null CheckstylePlugin Dependency Artifact from key [se.jguru.nazgul.tools.codestyle:nazgul-codestyle]. Not including null Artifact. * [DEBUG] executeCheckstyle start headerLocation : LICENSE.txt [DEBUG] Adding licenceArtifact [com.puppycrawl.tools:checkstyle:6.11.2] to resourceManager. [DEBUG] Adding licenceArtifact [org.slf4j:jcl-over-slf4j:1.5.6] to resourceManager. [DEBUG] Adding licenceArtifact [org.slf4j:slf4j-jdk14:1.5.6] to resourceMan= ager. Plugin configuration with relevant plugins: maven-checkstyle-plugin 2.18-SNAPSHOT ... left out for now... com.puppycrawl.tools checkstyle 6.19 se.foo foo-codestyle 1.9.3-SNAPSHOT se.jguru.nazgul.tools.codestyle nazgul-codestyle 5.0.1 org.slf4j jcl-over-slf4j 1.7.20 org.slf4j slf4j-jdk14 1.7.20 Relevant part of the plugin code: private List getCheckstylePluginDependenciesAsArtifacts( Map plugins, String hint ) { List artifacts =3D new ArrayList<>(); Plugin checkstylePlugin =3D plugins.get( plugin.getGroupId() + ":" + plugin.getArtifactId() ); if ( checkstylePlugin !=3D null ) { for ( *Dependency dep : checkstylePlugin.getDependencies()* ) *// Why do we not get all the Dependencies here?* { // @todo if we can filter on hints, it should be done here... String depKey =3D dep.getGroupId() + ":" + dep.getArtifactId(); final Artifact artifact =3D (Artifact) plugin.getArtifactMap().get( depKey ); if ( artifact !=3D null ) { artifacts.add( artifact ); } else if ( getLog().isDebugEnabled() ) { getLog().debug( "Got null CheckstylePlugin Dependency Artifact from key [" + depKey + "]. Excluding null Artifact from return List. " ); } } } return artifacts; } -- +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D+ | B=C3=A4sta h=C3=A4lsningar, | [sw. "Best regards"] | | Lennart J=C3=B6relid | EAI Architect & Integrator | | jGuru Europe AB | M=C3=B6lnlycke - Kista | | Email: lj@jguru.se | URL: www.jguru.se | Phone | (skype): jgurueurope | (intl): +46 708 507 603 | (domestic): 0708 - 507 603 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D+ --94eb2c070192efe0850536f558dd--