Index: /trunk/build.xml
===================================================================
--- /trunk/build.xml	(revision 16170)
+++ /trunk/build.xml	(revision 16171)
@@ -920,9 +920,10 @@
 
     <target name="checkstyle-compile" depends="init-properties">
+        <ivy:cachepath file="${tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/>
         <mkdir dir="${checkstyle-build.dir}"/>
         <javac sourcepath="" srcdir="${checkstyle.dir}/src" failonerror="true"
             destdir="${checkstyle-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
             includeantruntime="false" createMissingPackageInfoClass="false"
-            encoding="UTF-8" classpath="${checkstyle.dir}/checkstyle-all.jar">
+            encoding="UTF-8" classpathref="checkstyle.classpath">
         </javac>
     </target>
@@ -930,14 +931,16 @@
         <exec append="false" osfamily="unix" executable="bash" failifexecutionfails="true">
             <arg value="-c"/>
-            <arg value="(git ls-files src test --modified 2>/dev/null || svn status -q --ignore-externals src test) | grep -o '\(src\|test\)/.*' | xargs java -cp '${checkstyle.dir}/checkstyle-all.jar:${checkstyle-build.dir}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml | sed -e 's:\([^ ]*\) [^:]*/\([^:/]*.java\:[^:]*\):(\2)\1:'"/>
+            <arg value="(git ls-files src test --modified 2>/dev/null || svn status -q --ignore-externals src test) | grep -o '\(src\|test\)/.*' | xargs java -cp '${toString:checkstyle.classpath}:${checkstyle-build.dir}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml | sed -e 's:\([^ ]*\) [^:]*/\([^:/]*.java\:[^:]*\):(\2)\1:'"/>
         </exec>
         <exec append="false" osfamily="windows" executable="powershell" failifexecutionfails="true">
             <arg value="/c"/>
-            <arg value="svn status -q --ignore-externals src test | ForEach-Object {java -cp '${checkstyle.dir}/checkstyle-all.jar;${checkstyle-build.dir}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml $_.split(' ')[7]}"/>
+            <arg value="svn status -q --ignore-externals src test | ForEach-Object {java -cp '${toString:checkstyle.classpath};${checkstyle-build.dir}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml $_.split(' ')[7]}"/>
         </exec>
     </target>
     <target name="checkstyle" depends="checkstyle-compile">
-        <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
-             classpath="${checkstyle.dir}/checkstyle-all.jar:${checkstyle-build.dir}"/>
+        <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties">
+            <classpath refid="checkstyle.classpath"/>
+            <classpath path="${checkstyle-build.dir}"/>
+        </taskdef>
         <checkstyle config="${checkstyle.dir}/josm_checks.xml">
             <fileset dir="${base.dir}/src/org/openstreetmap/josm" includes="**/*.java"
@@ -1178,5 +1181,5 @@
         <ivy:retrieve pattern="${lib.dir}/runtime/[artifact]-[type].[ext]" conf="runtime"/>
         <ivy:retrieve pattern="${lib.dir}/sources/[artifact]-[type].[ext]" conf="sources"/>
-        <ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc" file="${tools.ivy}"/>
+        <ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc,checkstyle" file="${tools.ivy}"/>
     </target>
 </project>
Index: /trunk/tools/ivy.xml
===================================================================
--- /trunk/tools/ivy.xml	(revision 16170)
+++ /trunk/tools/ivy.xml	(revision 16171)
@@ -5,4 +5,5 @@
     <configurations>
         <conf name="javacc" description="Everything needed for running JavaCC"/>
+        <conf name="checkstyle" description="Everything needed for running Checkstyle"/>
         <conf name="proguard" description="Everything needed for running ProGuard"/>
         <conf name="pmd" description="Everything needed for running PMD"/>
@@ -12,4 +13,6 @@
         <!-- javacc->default -->
         <dependency org="net.java.dev.javacc" name="javacc" rev="7.0.3" conf="javacc->default"/>
+        <!-- checkstyle->default -->
+        <dependency org="com.puppycrawl.tools" name="checkstyle" rev="8.27" conf="checkstyle->default"/>
         <!-- proguard->default -->
         <dependency org="net.sf.proguard" name="proguard-anttask" rev="6.2.2" conf="proguard->default"/>
