I hate Java and I hate Java build systems even more. This is why for the most part I always try to keep things simple and just use javac
and java
directly where I can. However, invariably if you are going to touch other people’s Java you can’t avoid things like Gradle and Maven. Gradle isn’t too bad I suppose, but I spent hours and hours trying to figure out why I couldn’t do this:
gradle run -Djavax.net.debug=SSL,trustmanager
this was with 3.2.1 and seemingly it should work. I did my default assumption: It must be me doing something wrong, but after finally running:
gradle run -Djavax.net.debug=SSL,trustmanager --debug
and inspecting the output I discovered those commands are not being passed through. However, this also gave me the solution to the problem: Copy the command from the --debug
output (search for “Starting process ‘command”) and then paste that directly into the terminal where I could then insert -Djavax.net.debug=SSL,trustmanager
and run it. Hey presto, another example of build managers just getting in the way. I wonder if gradle just has a command like gradle show
to show the command that it would run?