This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git
commit 4b28ffa6da7fc3b074d21688141549d08b2cf4ce Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Wed Nov 4 19:01:54 2026 +0000 Combine duplicate ITs and give two vacuous ITs real assertions MCHECKSTYLE-225, -260 and -99 each become one IT. MCHECKSTYLE-222-no-resources now checks target/reports and the skip message, MCHECKSTYLE-54 checks that the sources were checked. Fixes #738 --- pom.xml | 5 +- src/it/MCHECKSTYLE-222-no-resources/verify.groovy | 9 +++- src/it/MCHECKSTYLE-225-LICENSE.txt/pom.xml | 35 ------------- src/it/MCHECKSTYLE-225-LICENSE.txt/verify.groovy | 24 --------- .../build-tools/pom.xml | 29 ---------- .../invoker.properties | 18 ------- src/it/MCHECKSTYLE-225-customHeader/pom.xml | 35 ------------- src/it/MCHECKSTYLE-225-customHeader/verify.groovy | 22 -------- .../build-tools/pom.xml | 29 ---------- .../src/main/resources/test/custom-header.txt | 1 - .../invoker.properties | 18 ------- .../MCHECKSTYLE-225-pluginManagement/verify.groovy | 22 -------- .../build-tools/pom.xml | 0 .../build-tools/src/main/resources/LICENSE.txt | 0 .../src/main/resources/test/custom-header.txt | 0 .../core-custom-header}/pom.xml | 2 +- .../core => MCHECKSTYLE-225/core-license}/pom.xml | 2 +- .../core => MCHECKSTYLE-225/core-managed}/pom.xml | 2 +- .../invoker.properties | 0 .../pom.xml | 4 +- .../verify.groovy | 15 ++++-- .../child-b/pom.xml | 56 -------------------- .../child-a/pom.xml | 56 -------------------- .../child-a/src/generated/java/org/MyClass.java | 24 --------- .../child-b/src/generated/java/org/MyClass.java | 24 --------- .../invoker.properties | 18 ------- .../MCHECKSTYLE-260-testSourceDirectories/pom.xml | 58 -------------------- .../verify.groovy | 24 --------- .../child-a/pom.xml | 9 ++++ .../child-a/src/generated/java/org/MyClass.java | 0 .../child-b/pom.xml | 9 ++++ .../child-b/src/generated/java/org/MyClass.java | 0 .../invoker.properties | 0 .../pom.xml | 5 +- .../verify.groovy | 7 ++- src/it/MCHECKSTYLE-54/verify.groovy | 5 ++ .../invoker.properties | 18 ------- .../pom.xml | 61 ---------------------- .../src/main/java/com/example/App.java | 32 ------------ .../src/test/java/com/example/AppTest.java | 24 --------- src/it/MCHECKSTYLE-99/invoker.properties | 2 +- src/it/MCHECKSTYLE-99/pom.xml | 29 ++++++++++ src/it/MCHECKSTYLE-99/verify.groovy | 15 ++++-- 43 files changed, 94 insertions(+), 654 deletions(-) diff --git a/pom.xml b/pom.xml index a98ae6d..2a3f0aa 100644 --- a/pom.xml +++ b/pom.xml @@ -284,9 +284,8 @@ under the License. These are license header templates. --> <exclude>src/main/resources/config/maven-header.txt</exclude> - <exclude>src/it/MCHECKSTYLE-225-customHeader/build-tools/src/main/resources/test/custom-header.txt</exclude> - <exclude>src/it/MCHECKSTYLE-225-pluginManagement/build-tools/src/main/resources/test/custom-header.txt</exclude> - <exclude>src/it/MCHECKSTYLE-225-LICENSE.txt/build-tools/src/main/resources/LICENSE.txt</exclude> + <exclude>src/it/MCHECKSTYLE-225/build-tools/src/main/resources/test/custom-header.txt</exclude> + <exclude>src/it/MCHECKSTYLE-225/build-tools/src/main/resources/LICENSE.txt</exclude> <exclude>src/test/resources/plugin-configs/target/test-harness/checkstyle/min/checkstyle-checker.xml</exclude> </inputExcludes> </configuration> diff --git a/src/it/MCHECKSTYLE-222-no-resources/verify.groovy b/src/it/MCHECKSTYLE-222-no-resources/verify.groovy index 7cc99c8..cd4c9cb 100644 --- a/src/it/MCHECKSTYLE-222-no-resources/verify.groovy +++ b/src/it/MCHECKSTYLE-222-no-resources/verify.groovy @@ -17,6 +17,11 @@ * under the License. */ -assert !(new File(basedir, 'target/site/checkstyle.html').exists()); +def buildLog = new File( basedir, 'build.log' ).text -return true; +// the goal ran and skipped the report, as there are no sources and no resources +assert buildLog.contains( "Skipping org.apache.maven.plugins:maven-checkstyle-plugin:" ) +assert buildLog.contains( ":checkstyle report goal" ) + +// checkstyle:checkstyle writes its report to target/reports +assert !new File( basedir, 'target/reports/checkstyle.html' ).exists() diff --git a/src/it/MCHECKSTYLE-225-LICENSE.txt/pom.xml b/src/it/MCHECKSTYLE-225-LICENSE.txt/pom.xml deleted file mode 100644 index e6a41ba..0000000 --- a/src/it/MCHECKSTYLE-225-LICENSE.txt/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.plugins.checkstyle</groupId> - <artifactId>mcheckstyle-225</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>pom</packaging> - - <modules> - <module>build-tools</module> - <module>core</module> - </modules> -</project> diff --git a/src/it/MCHECKSTYLE-225-LICENSE.txt/verify.groovy b/src/it/MCHECKSTYLE-225-LICENSE.txt/verify.groovy deleted file mode 100644 index 7d3e13f..0000000 --- a/src/it/MCHECKSTYLE-225-LICENSE.txt/verify.groovy +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -def buildLog = new File( basedir, 'build.log' ) -assert buildLog.text.contains( "The resource 'LICENSE.txt' was found" ) - -def checkstyleHeader = new File( basedir, 'core/target/checkstyle-header.txt') -assert checkstyleHeader.text == "MCHECKSTYLE-225 CUSTOM LICENSE" \ No newline at end of file diff --git a/src/it/MCHECKSTYLE-225-customHeader/build-tools/pom.xml b/src/it/MCHECKSTYLE-225-customHeader/build-tools/pom.xml deleted file mode 100644 index 8f50569..0000000 --- a/src/it/MCHECKSTYLE-225-customHeader/build-tools/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.plugins.checkstyle</groupId> - <artifactId>mcheckstyle-225-build-tools</artifactId> - <version>1.0-SNAPSHOT</version> -</project> diff --git a/src/it/MCHECKSTYLE-225-customHeader/invoker.properties b/src/it/MCHECKSTYLE-225-customHeader/invoker.properties deleted file mode 100644 index 71033d7..0000000 --- a/src/it/MCHECKSTYLE-225-customHeader/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -invoker.goals = verify diff --git a/src/it/MCHECKSTYLE-225-customHeader/pom.xml b/src/it/MCHECKSTYLE-225-customHeader/pom.xml deleted file mode 100644 index 7d2f7e0..0000000 --- a/src/it/MCHECKSTYLE-225-customHeader/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.plugins.checkstyle</groupId> - <artifactId>mcheckstyle-225</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>pom</packaging> - - <modules> - <module>build-tools</module> - <module>core</module> - </modules> -</project> diff --git a/src/it/MCHECKSTYLE-225-customHeader/verify.groovy b/src/it/MCHECKSTYLE-225-customHeader/verify.groovy deleted file mode 100644 index 8e52462..0000000 --- a/src/it/MCHECKSTYLE-225-customHeader/verify.groovy +++ /dev/null @@ -1,22 +0,0 @@ - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -def buildLog = new File( basedir, 'build.log' ) - -assert buildLog.text.contains( "The resource 'test/custom-header.txt' was found" ) diff --git a/src/it/MCHECKSTYLE-225-pluginManagement/build-tools/pom.xml b/src/it/MCHECKSTYLE-225-pluginManagement/build-tools/pom.xml deleted file mode 100644 index cd92c3b..0000000 --- a/src/it/MCHECKSTYLE-225-pluginManagement/build-tools/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.plugins.checkstyle</groupId> - <artifactId>mcheckstyle-225-build-tools</artifactId> - <version>1.0-SNAPSHOT</version> -</project> diff --git a/src/it/MCHECKSTYLE-225-pluginManagement/build-tools/src/main/resources/test/custom-header.txt b/src/it/MCHECKSTYLE-225-pluginManagement/build-tools/src/main/resources/test/custom-header.txt deleted file mode 100644 index 050fd16..0000000 --- a/src/it/MCHECKSTYLE-225-pluginManagement/build-tools/src/main/resources/test/custom-header.txt +++ /dev/null @@ -1 +0,0 @@ -This is a custom header file. \ No newline at end of file diff --git a/src/it/MCHECKSTYLE-225-pluginManagement/invoker.properties b/src/it/MCHECKSTYLE-225-pluginManagement/invoker.properties deleted file mode 100644 index 71033d7..0000000 --- a/src/it/MCHECKSTYLE-225-pluginManagement/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -invoker.goals = verify diff --git a/src/it/MCHECKSTYLE-225-pluginManagement/verify.groovy b/src/it/MCHECKSTYLE-225-pluginManagement/verify.groovy deleted file mode 100644 index f48e37c..0000000 --- a/src/it/MCHECKSTYLE-225-pluginManagement/verify.groovy +++ /dev/null @@ -1,22 +0,0 @@ - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -def buildLog = new File( basedir, 'build.log' ) - -assert buildLog.text.contains( "The resource 'test/custom-header.txt' was found" ) diff --git a/src/it/MCHECKSTYLE-225-LICENSE.txt/build-tools/pom.xml b/src/it/MCHECKSTYLE-225/build-tools/pom.xml similarity index 100% rename from src/it/MCHECKSTYLE-225-LICENSE.txt/build-tools/pom.xml rename to src/it/MCHECKSTYLE-225/build-tools/pom.xml diff --git a/src/it/MCHECKSTYLE-225-LICENSE.txt/build-tools/src/main/resources/LICENSE.txt b/src/it/MCHECKSTYLE-225/build-tools/src/main/resources/LICENSE.txt similarity index 100% rename from src/it/MCHECKSTYLE-225-LICENSE.txt/build-tools/src/main/resources/LICENSE.txt rename to src/it/MCHECKSTYLE-225/build-tools/src/main/resources/LICENSE.txt diff --git a/src/it/MCHECKSTYLE-225-customHeader/build-tools/src/main/resources/test/custom-header.txt b/src/it/MCHECKSTYLE-225/build-tools/src/main/resources/test/custom-header.txt similarity index 100% rename from src/it/MCHECKSTYLE-225-customHeader/build-tools/src/main/resources/test/custom-header.txt rename to src/it/MCHECKSTYLE-225/build-tools/src/main/resources/test/custom-header.txt diff --git a/src/it/MCHECKSTYLE-225-customHeader/core/pom.xml b/src/it/MCHECKSTYLE-225/core-custom-header/pom.xml similarity index 97% rename from src/it/MCHECKSTYLE-225-customHeader/core/pom.xml rename to src/it/MCHECKSTYLE-225/core-custom-header/pom.xml index 4ea2316..cc13602 100644 --- a/src/it/MCHECKSTYLE-225-customHeader/core/pom.xml +++ b/src/it/MCHECKSTYLE-225/core-custom-header/pom.xml @@ -24,7 +24,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.apache.maven.plugins.checkstyle</groupId> - <artifactId>mcheckstyle-225-core</artifactId> + <artifactId>mcheckstyle-225-core-custom-header</artifactId> <version>1.0-SNAPSHOT</version> <properties> diff --git a/src/it/MCHECKSTYLE-225-LICENSE.txt/core/pom.xml b/src/it/MCHECKSTYLE-225/core-license/pom.xml similarity index 97% rename from src/it/MCHECKSTYLE-225-LICENSE.txt/core/pom.xml rename to src/it/MCHECKSTYLE-225/core-license/pom.xml index ab68edc..0909091 100644 --- a/src/it/MCHECKSTYLE-225-LICENSE.txt/core/pom.xml +++ b/src/it/MCHECKSTYLE-225/core-license/pom.xml @@ -24,7 +24,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.apache.maven.plugins.checkstyle</groupId> - <artifactId>mcheckstyle-225-core</artifactId> + <artifactId>mcheckstyle-225-core-license</artifactId> <version>1.0-SNAPSHOT</version> <properties> diff --git a/src/it/MCHECKSTYLE-225-pluginManagement/core/pom.xml b/src/it/MCHECKSTYLE-225/core-managed/pom.xml similarity index 97% rename from src/it/MCHECKSTYLE-225-pluginManagement/core/pom.xml rename to src/it/MCHECKSTYLE-225/core-managed/pom.xml index 7fe3666..f4d87ab 100644 --- a/src/it/MCHECKSTYLE-225-pluginManagement/core/pom.xml +++ b/src/it/MCHECKSTYLE-225/core-managed/pom.xml @@ -28,7 +28,7 @@ <artifactId>mcheckstyle-225</artifactId> <version>1.0-SNAPSHOT</version> </parent> - <artifactId>mcheckstyle-225-core</artifactId> + <artifactId>mcheckstyle-225-core-managed</artifactId> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> diff --git a/src/it/MCHECKSTYLE-225-LICENSE.txt/invoker.properties b/src/it/MCHECKSTYLE-225/invoker.properties similarity index 100% rename from src/it/MCHECKSTYLE-225-LICENSE.txt/invoker.properties rename to src/it/MCHECKSTYLE-225/invoker.properties diff --git a/src/it/MCHECKSTYLE-225-pluginManagement/pom.xml b/src/it/MCHECKSTYLE-225/pom.xml similarity index 94% rename from src/it/MCHECKSTYLE-225-pluginManagement/pom.xml rename to src/it/MCHECKSTYLE-225/pom.xml index f61ae9e..dd5d127 100644 --- a/src/it/MCHECKSTYLE-225-pluginManagement/pom.xml +++ b/src/it/MCHECKSTYLE-225/pom.xml @@ -41,6 +41,8 @@ <modules> <module>build-tools</module> - <module>core</module> + <module>core-license</module> + <module>core-custom-header</module> + <module>core-managed</module> </modules> </project> diff --git a/src/it/MCHECKSTYLE-99-custom-xref-test-location/verify.groovy b/src/it/MCHECKSTYLE-225/verify.groovy similarity index 50% rename from src/it/MCHECKSTYLE-99-custom-xref-test-location/verify.groovy rename to src/it/MCHECKSTYLE-225/verify.groovy index 7245ce7..10399f9 100644 --- a/src/it/MCHECKSTYLE-99-custom-xref-test-location/verify.groovy +++ b/src/it/MCHECKSTYLE-225/verify.groovy @@ -18,9 +18,14 @@ * under the License. */ -report = new File( basedir, 'target/reports/checkstyle.html' ) -assert report.exists(); -assert report.text.contains( '<a href="./xref/com/example/App.html#L26">' ) -assert report.text.contains( '<a href="./custom-xref-test-location/com/example/AppTest.html#L23">' ) +def buildLog = new File( basedir, 'build.log' ).text -return true; +// core-license: the default header location LICENSE.txt is found in the plugin dependency +assert buildLog.contains( "The resource 'LICENSE.txt' was found" ) +assert new File( basedir, 'core-license/target/checkstyle-header.txt' ).text == "MCHECKSTYLE-225 CUSTOM LICENSE" + +// core-custom-header and core-managed: a custom header location is found in the plugin dependency, +// declared in the module or in the pluginManagement of its parent +assert buildLog.contains( "The resource 'test/custom-header.txt' was found" ) +assert new File( basedir, 'core-custom-header/target/checkstyle-header.txt' ).text == "This is a custom header file." +assert new File( basedir, 'core-managed/target/checkstyle-header.txt' ).text == "This is a custom header file." diff --git a/src/it/MCHECKSTYLE-260-sourceDirectories/child-b/pom.xml b/src/it/MCHECKSTYLE-260-sourceDirectories/child-b/pom.xml deleted file mode 100644 index be216df..0000000 --- a/src/it/MCHECKSTYLE-260-sourceDirectories/child-b/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - 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"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.maven.plugins.checkstyle.its</groupId> - <artifactId>parent</artifactId> - <version>1.0-SNAPSHOT</version> - </parent> - - <artifactId>child-b</artifactId> - - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <version>3.6.2</version> - <executions> - <execution> - <id>main-source</id> - <goals> - <goal>add-source</goal> - </goals> - <configuration> - <sources> - <source>src/generated/java</source> - </sources> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/src/it/MCHECKSTYLE-260-testSourceDirectories/child-a/pom.xml b/src/it/MCHECKSTYLE-260-testSourceDirectories/child-a/pom.xml deleted file mode 100644 index b23e035..0000000 --- a/src/it/MCHECKSTYLE-260-testSourceDirectories/child-a/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - 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"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.maven.plugins.checkstyle.its</groupId> - <artifactId>parent</artifactId> - <version>1.0-SNAPSHOT</version> - </parent> - - <artifactId>child-a</artifactId> - - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <version>3.6.2</version> - <executions> - <execution> - <id>test-source</id> - <goals> - <goal>add-test-source</goal> - </goals> - <configuration> - <sources> - <source>src/generated/java</source> - </sources> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/src/it/MCHECKSTYLE-260-testSourceDirectories/child-a/src/generated/java/org/MyClass.java b/src/it/MCHECKSTYLE-260-testSourceDirectories/child-a/src/generated/java/org/MyClass.java deleted file mode 100644 index c92fccf..0000000 --- a/src/it/MCHECKSTYLE-260-testSourceDirectories/child-a/src/generated/java/org/MyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -package org; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -public class MyClass -{ -} diff --git a/src/it/MCHECKSTYLE-260-testSourceDirectories/child-b/src/generated/java/org/MyClass.java b/src/it/MCHECKSTYLE-260-testSourceDirectories/child-b/src/generated/java/org/MyClass.java deleted file mode 100644 index c92fccf..0000000 --- a/src/it/MCHECKSTYLE-260-testSourceDirectories/child-b/src/generated/java/org/MyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -package org; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -public class MyClass -{ -} diff --git a/src/it/MCHECKSTYLE-260-testSourceDirectories/invoker.properties b/src/it/MCHECKSTYLE-260-testSourceDirectories/invoker.properties deleted file mode 100644 index 88f0d8f..0000000 --- a/src/it/MCHECKSTYLE-260-testSourceDirectories/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -invoker.goals=verify diff --git a/src/it/MCHECKSTYLE-260-testSourceDirectories/pom.xml b/src/it/MCHECKSTYLE-260-testSourceDirectories/pom.xml deleted file mode 100644 index 6659bc0..0000000 --- a/src/it/MCHECKSTYLE-260-testSourceDirectories/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.plugins.checkstyle.its</groupId> - <artifactId>parent</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>pom</packaging> - <url>https://issues.apache.org/jira/browse/MCHECKSTYLE-260</url> - <description>Tests that testSourceDirectory in honored in multi-module projects.</description> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> - <modules> - <module>child-a</module> - <module>child-b</module> - </modules> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <version>@project.version@</version> - <configuration> - <includeTestSourceDirectory>true</includeTestSourceDirectory> - <testSourceDirectories> - <testSourceDirectory>${project.build.sourceDirectory}</testSourceDirectory> - </testSourceDirectories> - </configuration> - <executions> - <execution> - <id>check</id> - <goals> - <goal>check</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file diff --git a/src/it/MCHECKSTYLE-260-testSourceDirectories/verify.groovy b/src/it/MCHECKSTYLE-260-testSourceDirectories/verify.groovy deleted file mode 100644 index 716910c..0000000 --- a/src/it/MCHECKSTYLE-260-testSourceDirectories/verify.groovy +++ /dev/null @@ -1,24 +0,0 @@ - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -def buildLog = new File( basedir, 'build.log' ) - -// 3 errors would be in child-a/src/generated/java and child-b/src/generated/java -// but both locations shouldn't be checked -assert !buildLog.text.contains( "[INFO] There are 3 errors reported by Checkstyle" ) diff --git a/src/it/MCHECKSTYLE-260-sourceDirectories/child-a/pom.xml b/src/it/MCHECKSTYLE-260/child-a/pom.xml similarity index 85% rename from src/it/MCHECKSTYLE-260-sourceDirectories/child-a/pom.xml rename to src/it/MCHECKSTYLE-260/child-a/pom.xml index f5faf1c..3993dee 100644 --- a/src/it/MCHECKSTYLE-260-sourceDirectories/child-a/pom.xml +++ b/src/it/MCHECKSTYLE-260/child-a/pom.xml @@ -33,6 +33,15 @@ <build> <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <configuration> + <sourceDirectories> + <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory> + </sourceDirectories> + </configuration> + </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> diff --git a/src/it/MCHECKSTYLE-260-sourceDirectories/child-a/src/generated/java/org/MyClass.java b/src/it/MCHECKSTYLE-260/child-a/src/generated/java/org/MyClass.java similarity index 100% rename from src/it/MCHECKSTYLE-260-sourceDirectories/child-a/src/generated/java/org/MyClass.java rename to src/it/MCHECKSTYLE-260/child-a/src/generated/java/org/MyClass.java diff --git a/src/it/MCHECKSTYLE-260-testSourceDirectories/child-b/pom.xml b/src/it/MCHECKSTYLE-260/child-b/pom.xml similarity index 84% rename from src/it/MCHECKSTYLE-260-testSourceDirectories/child-b/pom.xml rename to src/it/MCHECKSTYLE-260/child-b/pom.xml index 5b86bb2..d461f71 100644 --- a/src/it/MCHECKSTYLE-260-testSourceDirectories/child-b/pom.xml +++ b/src/it/MCHECKSTYLE-260/child-b/pom.xml @@ -33,6 +33,15 @@ <build> <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <configuration> + <testSourceDirectories> + <testSourceDirectory>${project.build.sourceDirectory}</testSourceDirectory> + </testSourceDirectories> + </configuration> + </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> diff --git a/src/it/MCHECKSTYLE-260-sourceDirectories/child-b/src/generated/java/org/MyClass.java b/src/it/MCHECKSTYLE-260/child-b/src/generated/java/org/MyClass.java similarity index 100% rename from src/it/MCHECKSTYLE-260-sourceDirectories/child-b/src/generated/java/org/MyClass.java rename to src/it/MCHECKSTYLE-260/child-b/src/generated/java/org/MyClass.java diff --git a/src/it/MCHECKSTYLE-260-sourceDirectories/invoker.properties b/src/it/MCHECKSTYLE-260/invoker.properties similarity index 100% rename from src/it/MCHECKSTYLE-260-sourceDirectories/invoker.properties rename to src/it/MCHECKSTYLE-260/invoker.properties diff --git a/src/it/MCHECKSTYLE-260-sourceDirectories/pom.xml b/src/it/MCHECKSTYLE-260/pom.xml similarity index 89% rename from src/it/MCHECKSTYLE-260-sourceDirectories/pom.xml rename to src/it/MCHECKSTYLE-260/pom.xml index 7280881..9cabc52 100644 --- a/src/it/MCHECKSTYLE-260-sourceDirectories/pom.xml +++ b/src/it/MCHECKSTYLE-260/pom.xml @@ -24,7 +24,7 @@ <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <url>https://issues.apache.org/jira/browse/MCHECKSTYLE-260</url> - <description>Tests that sourceDirectory in honored in multi-module projects.</description> + <description>Tests that sourceDirectories (child-a) and testSourceDirectories (child-b) are honored in multi-module projects.</description> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> @@ -40,9 +40,6 @@ <version>@project.version@</version> <configuration> <includeTestSourceDirectory>true</includeTestSourceDirectory> - <sourceDirectories> - <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory> - </sourceDirectories> </configuration> <executions> <execution> diff --git a/src/it/MCHECKSTYLE-260-sourceDirectories/verify.groovy b/src/it/MCHECKSTYLE-260/verify.groovy similarity index 74% rename from src/it/MCHECKSTYLE-260-sourceDirectories/verify.groovy rename to src/it/MCHECKSTYLE-260/verify.groovy index 716910c..95f0413 100644 --- a/src/it/MCHECKSTYLE-260-sourceDirectories/verify.groovy +++ b/src/it/MCHECKSTYLE-260/verify.groovy @@ -17,8 +17,11 @@ * specific language governing permissions and limitations * under the License. */ -def buildLog = new File( basedir, 'build.log' ) +def buildLog = new File( basedir, 'build.log' ).text // 3 errors would be in child-a/src/generated/java and child-b/src/generated/java // but both locations shouldn't be checked -assert !buildLog.text.contains( "[INFO] There are 3 errors reported by Checkstyle" ) +assert !buildLog.contains( "[INFO] There are 3 errors reported by Checkstyle" ) + +// the check ran in the parent and in both children: child-a with sourceDirectories, child-b with testSourceDirectories +assert buildLog.count( "[INFO] You have 0 Checkstyle violations." ) == 3 diff --git a/src/it/MCHECKSTYLE-54/verify.groovy b/src/it/MCHECKSTYLE-54/verify.groovy index 549c25a..87e16a6 100644 --- a/src/it/MCHECKSTYLE-54/verify.groovy +++ b/src/it/MCHECKSTYLE-54/verify.groovy @@ -22,3 +22,8 @@ def srcFile = new File(basedir, 'src/main/java/org/apache/maven/plugins/checksty def matcher = srcFile =~ /(\r\n|\r|\n)/ assert matcher[0][0].bytes == eol : "EOL in file should have been ${eol} but was ${matcher[0][0].bytes}" + +// the check ran on the sources, with their system line separators, and found nothing +def buildLog = new File( basedir, 'build.log' ).text +assert buildLog.contains( "Added 2 source files found in" ) : "the sources were not checked" +assert buildLog.contains( "[INFO] You have 0 Checkstyle violations." ) diff --git a/src/it/MCHECKSTYLE-99-custom-xref-test-location/invoker.properties b/src/it/MCHECKSTYLE-99-custom-xref-test-location/invoker.properties deleted file mode 100644 index 4adad81..0000000 --- a/src/it/MCHECKSTYLE-99-custom-xref-test-location/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -invoker.goals=clean checkstyle:checkstyle diff --git a/src/it/MCHECKSTYLE-99-custom-xref-test-location/pom.xml b/src/it/MCHECKSTYLE-99-custom-xref-test-location/pom.xml deleted file mode 100644 index e0b09bd..0000000 --- a/src/it/MCHECKSTYLE-99-custom-xref-test-location/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>com.example</groupId> - <artifactId>checkstyle-new</artifactId> - <packaging>jar</packaging> - <version>1.0-SNAPSHOT</version> - <name>checkstyle-new</name> - <url>http://maven.apache.org</url> - <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <version>@project.version@</version> - <configuration> - <configLocation>https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-8.28/src/main/resources/sun_checks.xml</configLocation> - <includeTestSourceDirectory>true</includeTestSourceDirectory> - <xrefTestLocation>custom-xref-test-location</xrefTestLocation> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jxr-plugin</artifactId> - <version>@jxrPluginVersion@</version> - </plugin> - </plugins> - </pluginManagement> - </build> - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jxr-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - </plugins> - </reporting> -</project> diff --git a/src/it/MCHECKSTYLE-99-custom-xref-test-location/src/main/java/com/example/App.java b/src/it/MCHECKSTYLE-99-custom-xref-test-location/src/main/java/com/example/App.java deleted file mode 100644 index 498f612..0000000 --- a/src/it/MCHECKSTYLE-99-custom-xref-test-location/src/main/java/com/example/App.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.example; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/src/it/MCHECKSTYLE-99-custom-xref-test-location/src/test/java/com/example/AppTest.java b/src/it/MCHECKSTYLE-99-custom-xref-test-location/src/test/java/com/example/AppTest.java deleted file mode 100644 index cbdd3d5..0000000 --- a/src/it/MCHECKSTYLE-99-custom-xref-test-location/src/test/java/com/example/AppTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.example; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -public class AppTest -{ -} \ No newline at end of file diff --git a/src/it/MCHECKSTYLE-99/invoker.properties b/src/it/MCHECKSTYLE-99/invoker.properties index 4adad81..2fdec7f 100644 --- a/src/it/MCHECKSTYLE-99/invoker.properties +++ b/src/it/MCHECKSTYLE-99/invoker.properties @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. -invoker.goals=clean checkstyle:checkstyle +invoker.goals=clean validate diff --git a/src/it/MCHECKSTYLE-99/pom.xml b/src/it/MCHECKSTYLE-99/pom.xml index 4baf6cc..e8fc627 100644 --- a/src/it/MCHECKSTYLE-99/pom.xml +++ b/src/it/MCHECKSTYLE-99/pom.xml @@ -44,6 +44,35 @@ under the License. </plugin> </plugins> </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <executions> + <execution> + <id>default-xref-test-location</id> + <phase>validate</phase> + <goals> + <goal>checkstyle</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/reports-default</outputDirectory> + </configuration> + </execution> + <execution> + <id>custom-xref-test-location</id> + <phase>validate</phase> + <goals> + <goal>checkstyle</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/reports-custom</outputDirectory> + <xrefTestLocation>custom-xref-test-location</xrefTestLocation> + </configuration> + </execution> + </executions> + </plugin> + </plugins> </build> <reporting> <plugins> diff --git a/src/it/MCHECKSTYLE-99/verify.groovy b/src/it/MCHECKSTYLE-99/verify.groovy index 80bc0d7..4c042e0 100644 --- a/src/it/MCHECKSTYLE-99/verify.groovy +++ b/src/it/MCHECKSTYLE-99/verify.groovy @@ -18,9 +18,14 @@ * under the License. */ -report = new File( basedir, 'target/reports/checkstyle.html' ) -assert report.exists(); -assert report.text.contains( '<a href="./xref/com/example/App.html#L26">' ) -assert report.text.contains( '<a href="./xref-test/com/example/AppTest.html#L23">' ) +// default xrefTestLocation +def defaultReport = new File( basedir, 'target/reports-default/checkstyle.html' ) +assert defaultReport.exists() +assert defaultReport.text.contains( '<a href="./xref/com/example/App.html#L26">' ) +assert defaultReport.text.contains( '<a href="./xref-test/com/example/AppTest.html#L23">' ) -return true; +// custom xrefTestLocation +def customReport = new File( basedir, 'target/reports-custom/checkstyle.html' ) +assert customReport.exists() +assert customReport.text.contains( '<a href="./xref/com/example/App.html#L26">' ) +assert customReport.text.contains( '<a href="./custom-xref-test-location/com/example/AppTest.html#L23">' )
