Force maven to fetch dependencies from remote - Seralahthan

文章推薦指數: 80 %
投票人數:10人

Could not resolve dependencies for project ... Maven will compare the local POM's timestamp (stored in a repository's maven-metadata file) to the remote. GetunlimitedaccessOpeninappHomeNotificationsListsStoriesWriteForcemaventofetchdependenciesfromremoteSometimesduringthemavenprojectbuild,someofthedependenciesmightgetpartiallydownloadedfromtheremoterepositorymanager(MavenCentralOrNexus)duetosomenetworkissues.Insuchcases,thefirsttimethebuildwillfail.Whenwetrytobuildtheprojectagain,wearemostlikelytogetthefollowingerrormessage.org.apache.maven.lifecycle.LifecycleExecutionException:Failedtoexecutegoalonprojectsaml2-web-app-pickup-manager:Couldnotresolvedependenciesforprojectorg.wso2.samples.is:saml2-web-app-pickup-manager:war:4.1.0:Failuretofindorg.wso2.samples.is:claim-manager:jar:4.1.0inhttp://maven.wso2.org/nexus/content/groups/wso2-public/wascachedinthelocalrepository,resolutionwillnotbereattempteduntiltheupdateintervalofwso2-nexushaselapsedorupdatesareforcedatorg.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:269)Herethebuildfailureoccursasmaventriestobuildfromthepartiallyfetcheddependencycachedinthelocalrepository.Mavenfetchesupdatesfromtheremoterepositoryaftertheupdateintervalelapses.Bydefault,theupdateintervalisdaily.UpdateintervalcanbeconfiguredforreleasesandsnapshotsbyconfiguringtheupdatePolicyinthepomfile.Mavendoesn’tfetchdependencyupdates(newversionreleases)Orreattempttofetchdependenciescachedinthelocalrepositorybeforetheupdateinterval.Therearefewwayswecanovercometheerror“resolutionwillnotbereattempteduntiltheupdateintervalof”Forcemaventofetchdependenciesfromtheremoterepositorywhilebuildingtheproject.Modifytheupdateinterval.Forcemaventofetchdependenciesfromtheremoterepositorywhilebuildingtheproject.Wecanuse-U/--update-snapshotsflagwhenbuildingamavenprojecttoforcemaventodownloaddependenciesfromtheremoterepository.mvncleaninstall-U-XHere,-U,--update-snapshots:Forcesacheckformissingreleasesandupdatedsnapshotsonremoterepositories.-X,--debug:Produceexecutiondebugoutput.Modifytheupdateinterval.Inthepom.xmlfileoftheproject,therewillbetherepositoriesandpluginRepositoriesconfiguredasbelow....truealwayswarntrueneverfail......truealwayswarntruealwaysfail...Makesuretochangethealwaysforthereleases(ifneededforthesnapshotsaswell).Generally,snapshotsareconfiguredwithnever.updatePolicy:Thiselementspecifieshowoftenupdatesshouldattempttooccur.MavenwillcomparethelocalPOM’stimestamp(storedinarepository’smaven-metadatafile)totheremote.Thechoicesare:always,daily(default),interval:X(whereXisanintegerinminutes)ornever.Refertotheofficialmavendocumentation[1]foradditionaldetails.References:[1]http://maven.apache.org/settings.html#RepositoriesThanksforreading!!!--MorefromSeralahthanFollowInterestedinBigData,ML&AI|SSE@WSO2|B.Sc.(Hons).CE|Integration&CIAMConsultantLovepodcastsoraudiobooks?Learnonthegowithournewapp.TryKnowableAboutHelpTermsPrivacyGettheMediumappGetstartedSeralahthan109FollowersInterestedinBigData,ML&AI|SSE@WSO2|B.Sc.(Hons).CE|Integration&CIAMConsultantFollowMorefromMediumFaisalKhanSupersonicJavaAWSLambdasusingQuarkusHeitorFurtadoConfiguringRabbitMQconnectioninSpringBootMartienvandenAkkerinvirtualsciencesLogginginCamelonSpring-BootusingtheFuseLoggerGiridharanShanmugavelStrategyPattern — Exemplified!HelpStatusWritersBlogCareersPrivacyTermsAboutKnowable



請為這篇文章評分?