Mvn dependency:copy-dependencies -DoutputDirectory=lib package Error

mvn dependency:copy-dependencies -DoutputDirectory=lib package Report an error
Based on the error message, call
mvn dependency:copy-dependencies -DoutputDirectory=lib package -e -X, the reason isĀ  Cannot access in offline mode

Solution:
idea -> setting -> maven
Uncheck Work offline

Read More: