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 F1A8218CF6 for ; Thu, 14 Jan 2016 23:59:38 +0000 (UTC) Received: (qmail 8355 invoked by uid 500); 14 Jan 2016 23:59:37 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 8268 invoked by uid 500); 14 Jan 2016 23:59:37 -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 8255 invoked by uid 99); 14 Jan 2016 23:59:37 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2016 23:59:37 +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 B529EC076A for ; Thu, 14 Jan 2016 23:59:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.101 X-Spam-Level: X-Spam-Status: No, score=-0.101 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 490s5TFI-53y for ; Thu, 14 Jan 2016 23:59:28 +0000 (UTC) Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com [209.85.192.180]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 3307543F44 for ; Thu, 14 Jan 2016 23:59:28 +0000 (UTC) Received: by mail-pf0-f180.google.com with SMTP id n128so107651931pfn.3 for ; Thu, 14 Jan 2016 15:59:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=nfF4M4+7su9d6ODv2XifHZ3lWqb9LUD6+p/VHd/L+t4=; b=afsMx1Xokf1jgLFwj53jAWkjfr3jBk6oBLJ2euP28xCEOM+LdFF5jvhbMkxoGkje4X Nv6PDlTZ1tPwRwl2kVNcchR/RmdWI/GRFKDmEfIbBxYdJpGpzqS1VcsEwmr1KV3UXKiX 7wdhOissYVfbxcEnwC5I0vXW+S0pobw9KTAmkHK9P/1FCispZ5q5wd8xAxeYCyqdgnQV GdYVn9j+Hstp7iT6YlenLnIWZ7RBDUjTlOqQdAwpHjcVn3ybdO4P3z7B5gOuEcIiCEFv po94VtqQKlg5+lK5KSK4PPGcewAiYDyGVqtlXWEnGTDYUYHuKk+5Dqsb9NNeiTccI3/i +hyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding; bh=nfF4M4+7su9d6ODv2XifHZ3lWqb9LUD6+p/VHd/L+t4=; b=dJoMpVMxjXUF6+rczchn8jyAjQ/8jp0eANvHS64u9oLub8hPuO1OeJkv8ZyC8//IC1 doYx49ShJH4B7ZLPxlnMsNG89IeIVZ81+u98LSG7WkhI9U78nbHZcRPuVJJRSRuNRX4P mtblFlwnQIiy/Yia1TTiLRROWQZ66c4Oo9EYFmNEAPObIM6BotWNLhca3uVpC7kXR+Lf /pIldpY7LDRW5D9ym7aby5loe8jLb9xKisHyT/IAa0uAsnmmEhoqOT8uvakgJLm155kF BjHXBIRaYSTCNf103Ce77++LrlGzion95H2S0exv4bqy2mYgdb98YcA4OxW6Uq1vFrWo QDwA== X-Gm-Message-State: AG10YOQfjq9fmE/NwTSuq2nytWIn5Tvrf+hFZLwyG/PL6HtUhysQlE0F4OK5+0VetXCIUQ== X-Received: by 10.98.93.131 with SMTP id n3mr5480740pfj.9.1452815967349; Thu, 14 Jan 2016 15:59:27 -0800 (PST) Received: from localhost.localdomain (mobile-166-176-187-232.mycingular.net. [166.176.187.232]) by smtp.gmail.com with ESMTPSA id w22sm11634328pfa.79.2016.01.14.15.59.26 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jan 2016 15:59:26 -0800 (PST) To: users@maven.apache.org From: "David M. Karr" Subject: Why is checkstyle failing on one project, but not others? Message-ID: <5698365C.5080901@gmail.com> Date: Thu, 14 Jan 2016 15:59:24 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit This may be a checkstyle-specific problem, but I'll start with the maven checkstyle plugin. I'm integrating a large codebase into another larger project that has checkstyle standards. After I added the parent pom spec to the top-level pom and ran the build, I noticed it successfully built several subprojects, but then fail with a checkstyle error on one subproject, perhaps the 10th subproject. The error was in the verification of the license header. I carefully examined the license header in the file, and then compared it to the header in one file in one of the subprojects that didn't get an error. They were identical. I did a "diff" on them to be certain. All of the existing files in the codebase have the same license header. I thought the issue was that this file was failing and it shouldn't be failing. However, when I actually looked closer at the regexp that it said wasn't matching, I realized that that the actual issue was that the projects that passed the checkstyle test should NOT have passed, because the specified license template did not match the header in the files. I then looked at the pom file for the failing project and the first one that wasn't failing. Except for the artifact name, they were identical, except for the fact that the failing subproject has their source directory as "src" instead of "src/main/java" (I didn't write this). I looked carefully at the build output for the "passing" project, and it showed it executing the checkstyle plugin and reporting no errors. So before I fix all of these license headers to match their standard (or argue that the template is overly specific), I'd like to truly understand what's happening here. For details, here is the header from the file that is failing: ------------- /******************************************************************************* * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * *******************************************************************************/ ------------------ And here is the "LICENSE.txt" file that is used for verification in the checkstyle configuration: ----------------------- ^/[*]+$ ^ \* Copyright (\([cC]\)|©) [0-9]{4}(, [0-9]{4})? .* All rights reserved.$ ^ \*( )?$ ^ \* This program and the accompanying materials are made available under the$ ^ \* terms of the Eclipse Public License v1.0 which accompanies this distribution,$ ^ \* and is available at http://www.eclipse.org/legal/epl-v10.html$ ^ [*]+/$ ---------------- As you can see (from careful inspection), the third line in the header has two spaces after the "*", but the template clearly only allows one. When I run the build in the project that is failing the check, it gives me the following, which I now understand to be "correct": ------------------- [INFO] --- maven-checkstyle-plugin:2.16:check (check-license) @ com.cisco.yangide.m2e.yang.tests --- [INFO] Starting audit... ..../src/com/cisco/yangide/m2e/yang/tests/YangGenerationTest.java:3: Line does not match expected header line of '^ \*( )?$'. Audit done. [INFO] There is 1 error reported by Checkstyle 6.2 with check-license.xml ruleset. [ERROR] src/com/cisco/yangide/m2e/yang/tests/YangGenerationTest.java[3] (header) RegexpHeader: Line does not match expected header line of '^ \*( )?$'. --------------------------- However, the following is the output I see for all the other subprojects, which are all in the build output before this failing one: -------------------- [INFO] --- maven-checkstyle-plugin:2.16:check (check-license) @ com.cisco.yangide.core --- [INFO] Starting audit... Audit done. [INFO] [INFO] --- maven-checkstyle-plugin:2.16:check (default) @ com.cisco.yangide.core --- [INFO] Starting audit... Audit done. ------------------ Any idea what's going on here? --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org