In case someone calls compile package there's no need for the separate compile call. Now the lifecycle is executed twice: once until compile and once again until package.
Note: package compile is weird due to its order, but should not be optimized. compile resources:copy-resources package is a bit complicated. Ideally this should call all phases up until compile, followed by resources:copy-resources, followed by the process-classes to package phases.