Skip to content

gragle-plugin thinResolve throws java.lang.UnsupportedOperationException #117

@sergeibez

Description

@sergeibez

If we try use 'thin.repo' with gradle-plugin the task 'thinResolve' throws java.lang.UnsupportedOperationException:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':thinResolve'
Caused by: java.lang.UnsupportedOperationException
at org.springframework.boot.experimental.gradle.ThinLauncherPlugin$6$1.execute(ThinLauncherPlugin.java:258)
at org.springframework.boot.experimental.gradle.ThinLauncherPlugin$6$1.execute(ThinLauncherPlugin.java:244)
...

I think the problem is in the method
ThinLauncherPlugin .createResolveTask (line 253-258)
because 'Arrays.asList(...)' creates an immutable list (and 'args.add(...)' throws an Exception):

List<String> args = Arrays.asList("-Dthin.root=.",
		"-Dthin.dryrun", "-jar",
		thinJar.getArchiveName());
String thinRepo = getThinRepo(project);
if (thinRepo != null) {
	args.add(1, "-Dthin.repo=" + thinRepo);
}

maven-plugin has no this problem because ArrayList is used:
List<String> cmd = new ArrayList<>(Arrays.asList(...));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions