18
18
import static java .util .Objects .requireNonNull ;
19
19
20
20
import java .io .File ;
21
+ import java .nio .file .Path ;
21
22
import java .nio .file .Paths ;
22
23
import java .util .function .Consumer ;
23
24
26
27
import org .gradle .api .Project ;
27
28
import org .gradle .api .artifacts .repositories .MavenArtifactRepository ;
28
29
29
- import com .diffplug .spotless .FileSignature ;
30
30
import com .diffplug .spotless .FormatterStep ;
31
31
import com .diffplug .spotless .rome .RomeStep ;
32
32
@@ -208,11 +208,7 @@ private File findDataDir() {
208
208
var localRepo = currentRepo != null ? (MavenArtifactRepository ) currentRepo : project .getRepositories ().mavenLocal ();
209
209
try {
210
210
// e.g. ~/.m2/repository/
211
- var path = localRepo .getUrl ().getPath ();
212
- if (FileSignature .machineIsWin () && path .startsWith ("/" )) {
213
- path = path .substring (1 );
214
- }
215
- var repoPath = Paths .get (path );
211
+ var repoPath = Path .of (localRepo .getUrl ());
216
212
var dataPath = repoPath .resolve ("com" ).resolve ("diffplug" ).resolve ("spotless" ).resolve ("spotless-data" );
217
213
return dataPath .toAbsolutePath ().toFile ();
218
214
} finally {
@@ -246,8 +242,6 @@ private RomeStep newBuilder() {
246
242
* the user's path. Otherwise resolve the executable path against the project's
247
243
* base directory.
248
244
*
249
- * @param config Configuration from the Maven Mojo execution with details about
250
- * the currently executed project.
251
245
* @return The resolved path to the Rome executable.
252
246
*/
253
247
private String resolvePathToExe () {
@@ -265,7 +259,6 @@ private String resolvePathToExe() {
265
259
* current project's directory. Otherwise, use the {@code Rome} sub folder in
266
260
* the shared data directory.
267
261
*
268
- * @param config Configuration for this step.
269
262
* @return The download directory for the Rome executable.
270
263
*/
271
264
private String resolveDownloadDir () {
0 commit comments