Re: Why is checkstyle failing on one project, but not others?

2016-01-15 Thread David M. Karr



On 01/14/2016 04:37 PM, e...@zusammenkunft.net wrote:

Hello,

Most likely the source directory is (incorrectly) overwritten at the compile 
plugin (or it is compiled by the parent pom or some other strange mechanisms 
like an ant plugin). The -X output (together with the effective pom) should 
tell you that as well.

Removing the , moving the files to src/main/java and removing 
all properties or compile plugin options would be the proper cleanup action to plan 
for the long run ,)

Certainly everything should be in "src/main/java".  In the meantime, I'd 
like to fully understand what's happening here.


After analyzing the "-X" output, I found that if I store my source in 
"src" and not set "sourceDirectory", the compiler plugin works fine (it 
looks in both "src/main/java" and "src" silently), but checkstyle 
apparently only looks in "src/main/java".  If I instead set 
"sourceDirectory" to "src", both the compiler and checkstyle plugins 
only look in "src".


This seems like a flaw in the checkstyle plugin to me.  It should be 
using the same source directories that were used by the compiler plugin.



-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Why is checkstyle failing on one project, but not others?

2016-01-14 Thread ecki
Hello,

Most likely the source directory is (incorrectly) overwritten at the compile 
plugin (or it is compiled by the parent pom or some other strange mechanisms 
like an ant plugin). The -X output (together with the effective pom) should 
tell you that as well.

Removing the , moving the files to src/main/java and removing 
all properties or compile plugin options would be the proper cleanup action to 
plan for the long run ,)

-- 
http://bernd.eckenfels.net

-Original Message-
From: "David M. Karr" 
To: Maven Users List 
Sent: Fr., 15 Jan. 2016 1:32
Subject: Re: Why is checkstyle failing on one project, but not others?

Ok, that gave me a big clue, and a new question.

I've realized that ALL of these projects are using "src" as their source 
root, instead of "src/main/java", but this one that is failing is the 
only one that specifies the "sourceDirectory" value. Those projects that 
aren't specifying the value are building just fine.  Is Maven just 
guessing "I must have meant 'src'" and just using what it found?

On 01/14/2016 04:15 PM, e...@zusammenkunft.net wrote:
> Hello,
>
> You can run the build with -X it will give you the actual config parameters 
> used for the plugin (especially includes/excludes/sourceDirectory) as well as 
> a list of the (not) scanned resources.
>
> Gruss
> Bernd
>


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Why is checkstyle failing on one project, but not others?

2016-01-14 Thread David M. Karr

Ok, that gave me a big clue, and a new question.

I've realized that ALL of these projects are using "src" as their source 
root, instead of "src/main/java", but this one that is failing is the 
only one that specifies the "sourceDirectory" value. Those projects that 
aren't specifying the value are building just fine.  Is Maven just 
guessing "I must have meant 'src'" and just using what it found?


On 01/14/2016 04:15 PM, e...@zusammenkunft.net wrote:

Hello,

You can run the build with -X it will give you the actual config parameters 
used for the plugin (especially includes/excludes/sourceDirectory) as well as a 
list of the (not) scanned resources.

Gruss
Bernd




-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Why is checkstyle failing on one project, but not others?

2016-01-14 Thread ecki
Hello,

You can run the build with -X it will give you the actual config parameters 
used for the plugin (especially includes/excludes/sourceDirectory) as well as a 
list of the (not) scanned resources.

Gruss
Bernd

-- 
http://bernd.eckenfels.net

-Original Message-
From: "David M. Karr" 
To: users@maven.apache.org
Sent: Fr., 15 Jan. 2016 0:59
Subject: Why is checkstyle failing on one project, but not others?

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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org