Error: Could not find or load main class Dlog4j.configurationFile=server-log4j2.xml
The startup script shows the correct setting,
@rem Add default JVM options here. You can also use JAVA_OPTS and XXX_SERVER_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="Dlog4j.configurationFile=server-log4j2.xml"
So when,
set DEFAULT_JVM_OPTS=
it cant find the xml file, even though its in the default package of the distribution jar and when its set it cant find the main class.
Lost many many hours to this. Stupid ass syntax error with a generic error description.
I couldnāt find where I read the info on the log4j2.xml being under the default package in the distribution jar but I know I read it and it was a one sentence blurb among the hundreds I have read. Searched bing and google and nothing now. I know I didnāt imagine it.
I am trying to understand how to get all the dependencies onto the classpath including local jars and how this line actually works.
The sdk/netbeans default script builds perfectly now so I am trying to get the simethereal task to do the same build but it is missing adding all the implementation configuration and local jars on the classpath.
I would like to read about it in the gradle docs if someone can point to the proper way to implement a solution.
I wonder if itās lazy-resolving the transitive dependencies. Usually there would be some way to get the resolved list of dependencies. I donāt know if any of that will help your google searching.
You might be able to look into how the regular application plugin sets up its own classpath⦠but that might take a little digging.
The good thing about Gradle is that it evolves very quickly and almost always for the better⦠the bad thing about Gradle is that it evolves very quickly and sometimes ābetterā will break an older build if you arenāt pegging the version with gradlew.
I have everything working (including gradlew) except this classpath part of the CreateStartScripts and I cant let go of stuff like this until I kill it.
I dont fully understand project.configurations.runtime since I cant find a reference to it in the docs yet.
Looks like there are no shortcuts on this one, gonna have to do it the old fashion way and learn it down to the last gory detail.
Since I donāt know where your understand falls off⦠Iāll explain what I know.
āprojectā is the instance of your project. The thing instantiated for your build file. (Hopefully this one was obvious.)
āconfigurationsā are the various project configurations for compile, runtime, etc⦠The things you attach dependencies to, basically. Everything in your ādependencyā block will map back to one of these. In newer gradle, the set of available configurations changed a LOT.
āruntimeā is then the āruntimeā Configuration. Itās the set of runtime dependencies⦠but should have methods/properties for getting just the local dependencies, resolving the transitive dependencies, etc⦠A long time ago, there were things like runtime.resolve or runtime.resolveTree or something and then they made it easier to work with as the configuration would provide the resolved set.
Additionally, the default distribution created by the plugin will contain all artifacts of the runtimeClasspath configuration instead of the deprecated runtime configuration.