Can I dynamically configure and run JavaExec task or something similar?

I have problem with my task and its configuration phase. I don’t want to configure JavaExec task every time I build, because even if run other tasks I need to supply some parameters with -P which are required in configuration phase of my JavaExec task.

Is there a way to run java program from jar as part of “normal” task, supplying arguments during execution task (and not in configuration phase)?

There’s no magic sauce for this at the moment. You’ll have to code up your own configuration that maps properties set with -P to the task’s args property.