chrisdchristo / capsule-maven-plugin

Capsule Maven Plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Capsule silently not overwritten if already exists

davidselassie opened this issue · comments

As far as I can tell, if the target capsule JAR file already exits, it is silently not overwritten. I have to manually delete the target or run clean in order for it to be built and changes in the code reflected in the capsule. It would be better if the capsule building step explicitly threw an error when this happens or warns and actually overwrites the target capsule.

Hi, yes thats right, the plugin will not overwrite the existing file. There is actually a log that will notify you of this, however its log level is debug (so you'd only see it if you do something like mvn install -X). Perhaps it makes more sense to change the log level to info so you'd see under normal circumstances. See next release for this change.

Ah, didn't notice the debug message. I guess I would argue that if I ask Maven to package the capsule, and it doesn't actually package my new code because the file already exists, that's an error, it didn't complete my command. I would have the step error out, just like when you ask Maven to install a version that already exists. Not sure if other people are already relying on this behavior.

Thanks for your help.

I concur with @selassid here that it would be better to overwrite the capsule on "mvn package", even if it is already there (otherwise it is very easy to think you have re-built a capsule when you really haven't, which can lead to some frustrating debugging sessions).

❤️