Checkstyle, Unable to create Root Module
I'm trying to configure Checkstyle in the project. I've added:
apply plugin: 'checkstyle'
checkstyle {
// assign the latest checkstyle version explicitly
// default version is very old, likes 5.9
toolVersion = '8.6'
// checkstyle.xml copy from:
// https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-8.6/src/main/resources/google_checks.xml
// the version should be as same as plugin version
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
}
task Checkstyle(type: Checkstyle) {
source 'src/main/java'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
// empty classpath
classpath = rootProject.files()
}
to my root gradle file in allprojects
.
But when I run ./gradlew checkstyle
I get:
* What went wrong:
Execution failed for task ':app:Checkstyle'.
> Unable to create Root Module: config {/Users/user/Development/project/config/checkstyle/checkstyle.xml}, classpath {null}.
Even the file with rules is located in specified dir.
android checkstyle
add a comment |
I'm trying to configure Checkstyle in the project. I've added:
apply plugin: 'checkstyle'
checkstyle {
// assign the latest checkstyle version explicitly
// default version is very old, likes 5.9
toolVersion = '8.6'
// checkstyle.xml copy from:
// https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-8.6/src/main/resources/google_checks.xml
// the version should be as same as plugin version
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
}
task Checkstyle(type: Checkstyle) {
source 'src/main/java'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
// empty classpath
classpath = rootProject.files()
}
to my root gradle file in allprojects
.
But when I run ./gradlew checkstyle
I get:
* What went wrong:
Execution failed for task ':app:Checkstyle'.
> Unable to create Root Module: config {/Users/user/Development/project/config/checkstyle/checkstyle.xml}, classpath {null}.
Even the file with rules is located in specified dir.
android checkstyle
It's probably theclasspath
line, which you should remove. But even better, organize your code so that your real code (that you want checked) is in a SourceSet (e.g.main
). Then you would not need to create a task at all, because the Checkstyle plugin already creates perfectly fine tasks for you.
– Thomas Jensen
Apr 4 '18 at 12:13
Removing the classpath gives a different error: > No value has been specified for property 'classpath'.
– fejd
May 28 '18 at 11:32
add a comment |
I'm trying to configure Checkstyle in the project. I've added:
apply plugin: 'checkstyle'
checkstyle {
// assign the latest checkstyle version explicitly
// default version is very old, likes 5.9
toolVersion = '8.6'
// checkstyle.xml copy from:
// https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-8.6/src/main/resources/google_checks.xml
// the version should be as same as plugin version
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
}
task Checkstyle(type: Checkstyle) {
source 'src/main/java'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
// empty classpath
classpath = rootProject.files()
}
to my root gradle file in allprojects
.
But when I run ./gradlew checkstyle
I get:
* What went wrong:
Execution failed for task ':app:Checkstyle'.
> Unable to create Root Module: config {/Users/user/Development/project/config/checkstyle/checkstyle.xml}, classpath {null}.
Even the file with rules is located in specified dir.
android checkstyle
I'm trying to configure Checkstyle in the project. I've added:
apply plugin: 'checkstyle'
checkstyle {
// assign the latest checkstyle version explicitly
// default version is very old, likes 5.9
toolVersion = '8.6'
// checkstyle.xml copy from:
// https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-8.6/src/main/resources/google_checks.xml
// the version should be as same as plugin version
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
}
task Checkstyle(type: Checkstyle) {
source 'src/main/java'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
// empty classpath
classpath = rootProject.files()
}
to my root gradle file in allprojects
.
But when I run ./gradlew checkstyle
I get:
* What went wrong:
Execution failed for task ':app:Checkstyle'.
> Unable to create Root Module: config {/Users/user/Development/project/config/checkstyle/checkstyle.xml}, classpath {null}.
Even the file with rules is located in specified dir.
android checkstyle
android checkstyle
edited Apr 4 '18 at 9:07
Dawid Hyży
asked Apr 4 '18 at 7:27
Dawid HyżyDawid Hyży
1,34431632
1,34431632
It's probably theclasspath
line, which you should remove. But even better, organize your code so that your real code (that you want checked) is in a SourceSet (e.g.main
). Then you would not need to create a task at all, because the Checkstyle plugin already creates perfectly fine tasks for you.
– Thomas Jensen
Apr 4 '18 at 12:13
Removing the classpath gives a different error: > No value has been specified for property 'classpath'.
– fejd
May 28 '18 at 11:32
add a comment |
It's probably theclasspath
line, which you should remove. But even better, organize your code so that your real code (that you want checked) is in a SourceSet (e.g.main
). Then you would not need to create a task at all, because the Checkstyle plugin already creates perfectly fine tasks for you.
– Thomas Jensen
Apr 4 '18 at 12:13
Removing the classpath gives a different error: > No value has been specified for property 'classpath'.
– fejd
May 28 '18 at 11:32
It's probably the
classpath
line, which you should remove. But even better, organize your code so that your real code (that you want checked) is in a SourceSet (e.g. main
). Then you would not need to create a task at all, because the Checkstyle plugin already creates perfectly fine tasks for you.– Thomas Jensen
Apr 4 '18 at 12:13
It's probably the
classpath
line, which you should remove. But even better, organize your code so that your real code (that you want checked) is in a SourceSet (e.g. main
). Then you would not need to create a task at all, because the Checkstyle plugin already creates perfectly fine tasks for you.– Thomas Jensen
Apr 4 '18 at 12:13
Removing the classpath gives a different error: > No value has been specified for property 'classpath'.
– fejd
May 28 '18 at 11:32
Removing the classpath gives a different error: > No value has been specified for property 'classpath'.
– fejd
May 28 '18 at 11:32
add a comment |
7 Answers
7
active
oldest
votes
I got this error when config/checkstyle/checkstyle.xml
contained a reference to a non-existent file. In my case, via:
<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/checkstyle-suppressions.xml"/> <!-- Oops: No such file! -->
</module>
Creating the file config/checkstyle/checkstyle-suppressions.xml
fixed the problem.
If it helps, its contents (with same header as checkstyle.xml
) was:
<suppressions>
<suppress files="/generated/" checks="w+"/>
<suppress files="/test/" checks="w+"/>
</suppressions>
add a comment |
I was also having similar issue and same exception message. The following steps solved my problem:
Updated tool version to 8.16. Before I had 8.1
I used 'configDir' instead of 'configFile' property.
configDir = file("$rootProject.projectDir/etc/checkstyle")
Before it was:
configFile = file("$rootProject.projectDir/etc/checkstyle/checkstyle.xml")
Additionally, I had a 'reportDir' property which was also changed to point the directory instead of file.
reportsDir = file("$project.buildDir/reports/checkstyle")
Before it was:
reportsDir = file("$project.buildDir/reports/checkstyle/checkstyle.xml")
I am using JDK 11 and it worked with it.
I usedconfigDir = file("$rootProject.projectDir/config/checkstyle")
– java_dude
2 days ago
add a comment |
This error happens whenever the config file could not be read. Are you sure you have a /Users/user/Development/project/config/checkstyle/checkstyle.xml
file ?
add a comment |
I had a very similar problem, and I basically used the answer by @Bohemian. checkStyle could not find a file so I force-fed it waht it wanted. In my case, the root cause was that the gradle plugin for NetBeans does not propagate all "environment" variables correctly, so a reference to ${basedir}/config/checkstyle/import-control.xml
failed. When checkStyle
is running in NetBeans, ${basedir}
is set to $USER_HOME
, instead of the root of the project. As a workaround, I copied the required files into my home directory, and that allows checkStyle
to run correctly.
Ugly, but better than nothing.
add a comment |
Problem was that it couldn't find rules file. So I changed:
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
to:
configFile = file("${rootDir}/config/checkstyle/ckeckstyle.xml")
and now it pick up it correctly.
add a comment |
This happened to me when I updated Android Gradle Plugin to 3.3.0
Please run this:
./gradlew checkstyle --stacktrace
Probably you will need to check your checkstyle.xml config file.
I needed to move those two tags:
<module name="SuppressionCommentFilter"/>
<!--Enable usage SUPPRESS CHECKSTYLE comment-->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="CHECKSTYLE IGNORE"/>
<property name="checkFormat" value=".*"/>
<property name="influenceFormat" value="0"/>
</module>
inside
<module name="TreeWalker">
tag
Also I needed to remove:
<module name="SuppressionCommentFilter"/>
Do you mean Gradle or Android Gradle Plugin? My Gradle version was above 4.
– Dawid Hyży
Feb 19 at 4:28
Android Gradle Plugin
– Mladen Rakonjac
Feb 19 at 8:18
I had this issue before 3.3.0 was released and this was an root cause: stackoverflow.com/a/53328412/1048418
– Dawid Hyży
Feb 19 at 10:37
add a comment |
My problem was that this process was being run from a different directory than I thought it was.
Even though I checked to make sure the checkstyle.xml
did indeed exist in the path that it showed, it still was breaking because my build process was failing to cd
to the correct directory to run this!
Make sure you're running this from the place you think you are!
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49645147%2fcheckstyle-unable-to-create-root-module%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
I got this error when config/checkstyle/checkstyle.xml
contained a reference to a non-existent file. In my case, via:
<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/checkstyle-suppressions.xml"/> <!-- Oops: No such file! -->
</module>
Creating the file config/checkstyle/checkstyle-suppressions.xml
fixed the problem.
If it helps, its contents (with same header as checkstyle.xml
) was:
<suppressions>
<suppress files="/generated/" checks="w+"/>
<suppress files="/test/" checks="w+"/>
</suppressions>
add a comment |
I got this error when config/checkstyle/checkstyle.xml
contained a reference to a non-existent file. In my case, via:
<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/checkstyle-suppressions.xml"/> <!-- Oops: No such file! -->
</module>
Creating the file config/checkstyle/checkstyle-suppressions.xml
fixed the problem.
If it helps, its contents (with same header as checkstyle.xml
) was:
<suppressions>
<suppress files="/generated/" checks="w+"/>
<suppress files="/test/" checks="w+"/>
</suppressions>
add a comment |
I got this error when config/checkstyle/checkstyle.xml
contained a reference to a non-existent file. In my case, via:
<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/checkstyle-suppressions.xml"/> <!-- Oops: No such file! -->
</module>
Creating the file config/checkstyle/checkstyle-suppressions.xml
fixed the problem.
If it helps, its contents (with same header as checkstyle.xml
) was:
<suppressions>
<suppress files="/generated/" checks="w+"/>
<suppress files="/test/" checks="w+"/>
</suppressions>
I got this error when config/checkstyle/checkstyle.xml
contained a reference to a non-existent file. In my case, via:
<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/checkstyle-suppressions.xml"/> <!-- Oops: No such file! -->
</module>
Creating the file config/checkstyle/checkstyle-suppressions.xml
fixed the problem.
If it helps, its contents (with same header as checkstyle.xml
) was:
<suppressions>
<suppress files="/generated/" checks="w+"/>
<suppress files="/test/" checks="w+"/>
</suppressions>
answered Jul 21 '18 at 17:52
Bohemian♦Bohemian
299k65428565
299k65428565
add a comment |
add a comment |
I was also having similar issue and same exception message. The following steps solved my problem:
Updated tool version to 8.16. Before I had 8.1
I used 'configDir' instead of 'configFile' property.
configDir = file("$rootProject.projectDir/etc/checkstyle")
Before it was:
configFile = file("$rootProject.projectDir/etc/checkstyle/checkstyle.xml")
Additionally, I had a 'reportDir' property which was also changed to point the directory instead of file.
reportsDir = file("$project.buildDir/reports/checkstyle")
Before it was:
reportsDir = file("$project.buildDir/reports/checkstyle/checkstyle.xml")
I am using JDK 11 and it worked with it.
I usedconfigDir = file("$rootProject.projectDir/config/checkstyle")
– java_dude
2 days ago
add a comment |
I was also having similar issue and same exception message. The following steps solved my problem:
Updated tool version to 8.16. Before I had 8.1
I used 'configDir' instead of 'configFile' property.
configDir = file("$rootProject.projectDir/etc/checkstyle")
Before it was:
configFile = file("$rootProject.projectDir/etc/checkstyle/checkstyle.xml")
Additionally, I had a 'reportDir' property which was also changed to point the directory instead of file.
reportsDir = file("$project.buildDir/reports/checkstyle")
Before it was:
reportsDir = file("$project.buildDir/reports/checkstyle/checkstyle.xml")
I am using JDK 11 and it worked with it.
I usedconfigDir = file("$rootProject.projectDir/config/checkstyle")
– java_dude
2 days ago
add a comment |
I was also having similar issue and same exception message. The following steps solved my problem:
Updated tool version to 8.16. Before I had 8.1
I used 'configDir' instead of 'configFile' property.
configDir = file("$rootProject.projectDir/etc/checkstyle")
Before it was:
configFile = file("$rootProject.projectDir/etc/checkstyle/checkstyle.xml")
Additionally, I had a 'reportDir' property which was also changed to point the directory instead of file.
reportsDir = file("$project.buildDir/reports/checkstyle")
Before it was:
reportsDir = file("$project.buildDir/reports/checkstyle/checkstyle.xml")
I am using JDK 11 and it worked with it.
I was also having similar issue and same exception message. The following steps solved my problem:
Updated tool version to 8.16. Before I had 8.1
I used 'configDir' instead of 'configFile' property.
configDir = file("$rootProject.projectDir/etc/checkstyle")
Before it was:
configFile = file("$rootProject.projectDir/etc/checkstyle/checkstyle.xml")
Additionally, I had a 'reportDir' property which was also changed to point the directory instead of file.
reportsDir = file("$project.buildDir/reports/checkstyle")
Before it was:
reportsDir = file("$project.buildDir/reports/checkstyle/checkstyle.xml")
I am using JDK 11 and it worked with it.
answered Jan 16 at 9:51
Waqar DethoWaqar Detho
996813
996813
I usedconfigDir = file("$rootProject.projectDir/config/checkstyle")
– java_dude
2 days ago
add a comment |
I usedconfigDir = file("$rootProject.projectDir/config/checkstyle")
– java_dude
2 days ago
I used
configDir = file("$rootProject.projectDir/config/checkstyle")
– java_dude
2 days ago
I used
configDir = file("$rootProject.projectDir/config/checkstyle")
– java_dude
2 days ago
add a comment |
This error happens whenever the config file could not be read. Are you sure you have a /Users/user/Development/project/config/checkstyle/checkstyle.xml
file ?
add a comment |
This error happens whenever the config file could not be read. Are you sure you have a /Users/user/Development/project/config/checkstyle/checkstyle.xml
file ?
add a comment |
This error happens whenever the config file could not be read. Are you sure you have a /Users/user/Development/project/config/checkstyle/checkstyle.xml
file ?
This error happens whenever the config file could not be read. Are you sure you have a /Users/user/Development/project/config/checkstyle/checkstyle.xml
file ?
answered Jul 6 '18 at 16:33
Hamdi DoussHamdi Douss
629514
629514
add a comment |
add a comment |
I had a very similar problem, and I basically used the answer by @Bohemian. checkStyle could not find a file so I force-fed it waht it wanted. In my case, the root cause was that the gradle plugin for NetBeans does not propagate all "environment" variables correctly, so a reference to ${basedir}/config/checkstyle/import-control.xml
failed. When checkStyle
is running in NetBeans, ${basedir}
is set to $USER_HOME
, instead of the root of the project. As a workaround, I copied the required files into my home directory, and that allows checkStyle
to run correctly.
Ugly, but better than nothing.
add a comment |
I had a very similar problem, and I basically used the answer by @Bohemian. checkStyle could not find a file so I force-fed it waht it wanted. In my case, the root cause was that the gradle plugin for NetBeans does not propagate all "environment" variables correctly, so a reference to ${basedir}/config/checkstyle/import-control.xml
failed. When checkStyle
is running in NetBeans, ${basedir}
is set to $USER_HOME
, instead of the root of the project. As a workaround, I copied the required files into my home directory, and that allows checkStyle
to run correctly.
Ugly, but better than nothing.
add a comment |
I had a very similar problem, and I basically used the answer by @Bohemian. checkStyle could not find a file so I force-fed it waht it wanted. In my case, the root cause was that the gradle plugin for NetBeans does not propagate all "environment" variables correctly, so a reference to ${basedir}/config/checkstyle/import-control.xml
failed. When checkStyle
is running in NetBeans, ${basedir}
is set to $USER_HOME
, instead of the root of the project. As a workaround, I copied the required files into my home directory, and that allows checkStyle
to run correctly.
Ugly, but better than nothing.
I had a very similar problem, and I basically used the answer by @Bohemian. checkStyle could not find a file so I force-fed it waht it wanted. In my case, the root cause was that the gradle plugin for NetBeans does not propagate all "environment" variables correctly, so a reference to ${basedir}/config/checkstyle/import-control.xml
failed. When checkStyle
is running in NetBeans, ${basedir}
is set to $USER_HOME
, instead of the root of the project. As a workaround, I copied the required files into my home directory, and that allows checkStyle
to run correctly.
Ugly, but better than nothing.
answered Aug 10 '18 at 5:21
CharlweedCharlweed
6952718
6952718
add a comment |
add a comment |
Problem was that it couldn't find rules file. So I changed:
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
to:
configFile = file("${rootDir}/config/checkstyle/ckeckstyle.xml")
and now it pick up it correctly.
add a comment |
Problem was that it couldn't find rules file. So I changed:
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
to:
configFile = file("${rootDir}/config/checkstyle/ckeckstyle.xml")
and now it pick up it correctly.
add a comment |
Problem was that it couldn't find rules file. So I changed:
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
to:
configFile = file("${rootDir}/config/checkstyle/ckeckstyle.xml")
and now it pick up it correctly.
Problem was that it couldn't find rules file. So I changed:
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
to:
configFile = file("${rootDir}/config/checkstyle/ckeckstyle.xml")
and now it pick up it correctly.
answered Nov 15 '18 at 21:52
Dawid HyżyDawid Hyży
1,34431632
1,34431632
add a comment |
add a comment |
This happened to me when I updated Android Gradle Plugin to 3.3.0
Please run this:
./gradlew checkstyle --stacktrace
Probably you will need to check your checkstyle.xml config file.
I needed to move those two tags:
<module name="SuppressionCommentFilter"/>
<!--Enable usage SUPPRESS CHECKSTYLE comment-->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="CHECKSTYLE IGNORE"/>
<property name="checkFormat" value=".*"/>
<property name="influenceFormat" value="0"/>
</module>
inside
<module name="TreeWalker">
tag
Also I needed to remove:
<module name="SuppressionCommentFilter"/>
Do you mean Gradle or Android Gradle Plugin? My Gradle version was above 4.
– Dawid Hyży
Feb 19 at 4:28
Android Gradle Plugin
– Mladen Rakonjac
Feb 19 at 8:18
I had this issue before 3.3.0 was released and this was an root cause: stackoverflow.com/a/53328412/1048418
– Dawid Hyży
Feb 19 at 10:37
add a comment |
This happened to me when I updated Android Gradle Plugin to 3.3.0
Please run this:
./gradlew checkstyle --stacktrace
Probably you will need to check your checkstyle.xml config file.
I needed to move those two tags:
<module name="SuppressionCommentFilter"/>
<!--Enable usage SUPPRESS CHECKSTYLE comment-->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="CHECKSTYLE IGNORE"/>
<property name="checkFormat" value=".*"/>
<property name="influenceFormat" value="0"/>
</module>
inside
<module name="TreeWalker">
tag
Also I needed to remove:
<module name="SuppressionCommentFilter"/>
Do you mean Gradle or Android Gradle Plugin? My Gradle version was above 4.
– Dawid Hyży
Feb 19 at 4:28
Android Gradle Plugin
– Mladen Rakonjac
Feb 19 at 8:18
I had this issue before 3.3.0 was released and this was an root cause: stackoverflow.com/a/53328412/1048418
– Dawid Hyży
Feb 19 at 10:37
add a comment |
This happened to me when I updated Android Gradle Plugin to 3.3.0
Please run this:
./gradlew checkstyle --stacktrace
Probably you will need to check your checkstyle.xml config file.
I needed to move those two tags:
<module name="SuppressionCommentFilter"/>
<!--Enable usage SUPPRESS CHECKSTYLE comment-->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="CHECKSTYLE IGNORE"/>
<property name="checkFormat" value=".*"/>
<property name="influenceFormat" value="0"/>
</module>
inside
<module name="TreeWalker">
tag
Also I needed to remove:
<module name="SuppressionCommentFilter"/>
This happened to me when I updated Android Gradle Plugin to 3.3.0
Please run this:
./gradlew checkstyle --stacktrace
Probably you will need to check your checkstyle.xml config file.
I needed to move those two tags:
<module name="SuppressionCommentFilter"/>
<!--Enable usage SUPPRESS CHECKSTYLE comment-->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="CHECKSTYLE IGNORE"/>
<property name="checkFormat" value=".*"/>
<property name="influenceFormat" value="0"/>
</module>
inside
<module name="TreeWalker">
tag
Also I needed to remove:
<module name="SuppressionCommentFilter"/>
edited Feb 19 at 8:19
answered Feb 17 at 13:34
Mladen RakonjacMladen Rakonjac
4,83742338
4,83742338
Do you mean Gradle or Android Gradle Plugin? My Gradle version was above 4.
– Dawid Hyży
Feb 19 at 4:28
Android Gradle Plugin
– Mladen Rakonjac
Feb 19 at 8:18
I had this issue before 3.3.0 was released and this was an root cause: stackoverflow.com/a/53328412/1048418
– Dawid Hyży
Feb 19 at 10:37
add a comment |
Do you mean Gradle or Android Gradle Plugin? My Gradle version was above 4.
– Dawid Hyży
Feb 19 at 4:28
Android Gradle Plugin
– Mladen Rakonjac
Feb 19 at 8:18
I had this issue before 3.3.0 was released and this was an root cause: stackoverflow.com/a/53328412/1048418
– Dawid Hyży
Feb 19 at 10:37
Do you mean Gradle or Android Gradle Plugin? My Gradle version was above 4.
– Dawid Hyży
Feb 19 at 4:28
Do you mean Gradle or Android Gradle Plugin? My Gradle version was above 4.
– Dawid Hyży
Feb 19 at 4:28
Android Gradle Plugin
– Mladen Rakonjac
Feb 19 at 8:18
Android Gradle Plugin
– Mladen Rakonjac
Feb 19 at 8:18
I had this issue before 3.3.0 was released and this was an root cause: stackoverflow.com/a/53328412/1048418
– Dawid Hyży
Feb 19 at 10:37
I had this issue before 3.3.0 was released and this was an root cause: stackoverflow.com/a/53328412/1048418
– Dawid Hyży
Feb 19 at 10:37
add a comment |
My problem was that this process was being run from a different directory than I thought it was.
Even though I checked to make sure the checkstyle.xml
did indeed exist in the path that it showed, it still was breaking because my build process was failing to cd
to the correct directory to run this!
Make sure you're running this from the place you think you are!
add a comment |
My problem was that this process was being run from a different directory than I thought it was.
Even though I checked to make sure the checkstyle.xml
did indeed exist in the path that it showed, it still was breaking because my build process was failing to cd
to the correct directory to run this!
Make sure you're running this from the place you think you are!
add a comment |
My problem was that this process was being run from a different directory than I thought it was.
Even though I checked to make sure the checkstyle.xml
did indeed exist in the path that it showed, it still was breaking because my build process was failing to cd
to the correct directory to run this!
Make sure you're running this from the place you think you are!
My problem was that this process was being run from a different directory than I thought it was.
Even though I checked to make sure the checkstyle.xml
did indeed exist in the path that it showed, it still was breaking because my build process was failing to cd
to the correct directory to run this!
Make sure you're running this from the place you think you are!
answered Nov 14 '18 at 15:46
jacoballenwoodjacoballenwood
9481024
9481024
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49645147%2fcheckstyle-unable-to-create-root-module%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It's probably the
classpath
line, which you should remove. But even better, organize your code so that your real code (that you want checked) is in a SourceSet (e.g.main
). Then you would not need to create a task at all, because the Checkstyle plugin already creates perfectly fine tasks for you.– Thomas Jensen
Apr 4 '18 at 12:13
Removing the classpath gives a different error: > No value has been specified for property 'classpath'.
– fejd
May 28 '18 at 11:32