Hello,

Taher Alkhateeb <slidingfilame...@gmail.com> writes:

> I think I understand the reason why this is happening. Someone changed
> the implementation of createOfbizCommandTask to depend on the classes
> directly instead of depending on the generated Jar. I'm not sure why
> but I personally do not prefer this approach.
>
> The solution is to revert to the original design where the classpath =
> files(thejarfilehere) and change dependsOn from classes to build

Running OFBiz via Gradle only depends on building the classes because it
does not need more.  Depending on stuff like :jar or :build will only
slow down the recompilation process for no sound benefits.  Additionally
this approach matches what is done for the standard :run task.

The whole idea of running a program from Gradle which is a *build* tool
is to make sure that the executable is in sync with the current state of
the sources which is important in a development context.  As a
consequence the idea of disabling this fundamental feature in presence
of the --shutdown option simply does not make sense.

If people want to be in charge of the compilation and execution
lifecycles, they are free to use Gradle to build an artifact and run
OFBiz outside of their build tool like in the following example:

```
$ ./gradlew jar
$ java -jar build/libs/ofbiz &
$ java -jar build/libs/ofbiz --shutDown
```

I will not try to argue with people that this is the right approach so
feel free to ignore my input if it does not make sense. In any case you
have my blessing for reverting what “someone” sneaked in the code
base. ;-)

Regards,

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

Reply via email to