This message was deleted.
# general
s
This message was deleted.
j
Not totally sure, but this might be an ordering problem. Your plugin comes first here:
Copy code
plugins {
    id 'java'
    id 'com.agorapulse.gradle.java-common-configuration'
    id 'application'
}
Your JavaExec configuration is evaluated first. The application plugin probably overwrites the classpath with its own JavaExec configuration.
Btw, you can write this more compact:
Copy code
Configuration developmentOnly = Optional.ofNullable(configurations.findByName("developmentOnly")).orElseGet(
            () -> configurations.create("developmentOnly")
        );
->
Copy code
Configuration developmentOnly = configurations.maybeCreate("developmentOnly")
๐Ÿ™Œ 1
v
indeed. I thought that the order does not matter because itโ€™s evaluated in a different phase but I was obviously wrong. thank you very much @Jendrik Johannes
is this an overkill just be sure that nothing breaks when someone does the same
Copy code
Configuration developmentOnly = project.getConfigurations().maybeCreate("developmentOnly");

        tasks.withType(JavaExec.class, exec -> exec.classpath(developmentOnly));

        project.getPluginManager().withPlugin("application", p -> {
            tasks.withType(JavaExec.class, exec -> exec.classpath(developmentOnly));
        });
j
That looks good. If you really want to set it for every JavaExec task. ๐Ÿ™‚