How to Fix Maven Artifacts Could not be Resolved Error ...

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

I executed below command to install it in my localhost maven repo and everything worked. ... Could not resolve dependencies for project ... SkiptomaincontentSkiptoprimarysidebarSkiptofooterAdditionalmenu Advertisement Irememberlongtimeago,IfacedthesameerrorandItriedfixing itbymanuallyadding.jarfilestomymavenrepositorylocally. Iexecutedbelowcommandtoinstallitinmylocalhostmavenrepoandeverythingworked. 12345678 #echo"installingjmxri1.2.1"mvninstall:install-file-Dfile=lib/jmxri-1.2.1.jar-DgroupId=com.sun.jmx-DartifactId=jmxri-Dversion=1.2.1-Dpackaging=jar #echo"installingjmxtools1.2.1"mvninstall:install-file-Dfile=lib/jmxtools-1.2.1.jar-DgroupId=com.sun.jdmk-DartifactId=jmxtools-Dversion=1.2.1-Dpackaging=jar #echo"installingjms1.1"mvninstall:install-file-Dfile=lib/jms-1.1.jar-DgroupId=javax.jms-DartifactId=jms-Dversion=1.1-Dpackaging=jar Jarfileswillbeinstalledatprovidedlocationonceyouexecuteabovecommand: ButIdidn’ttrytofixthispermanently.RecentlyIchangedmylaptopandagainIstartedseeingtheissueasseenbelowasallmymanuallyinsertedjarfilesweregone. 1234567891011 Thefollowingartifactscouldnotberesolved:javax.jms:jms:jar:1.1,com.sun.jdmk:jmxtools:jar:1.2.1,com.sun.jmx:jmxri:jar:1.2.1:Couldnottransferartifactjavax.jms:jms:jar:1.1from/tojava.net(https://maven-repository.dev.java.net/nonav/repository):Cannotaccesshttps://maven-repository.dev.java.net/nonav/repositorywithtypelegacyusingtheavailableconnectorfactories:BasicRepositoryConnectorFactory:Cannotaccesshttps://maven-repository.dev.java.net/nonav/repositorywithtypelegacyusingtheavailablelayoutfactories:Maven2RepositoryLayoutFactory:Unsupportedrepositorylayoutlegacy->[Help1] org.apache.maven.lifecycle.LifecycleExecutionException:Failedtoexecutegoalonprojectcrunchify-tutorial:Couldnotresolvedependenciesforprojectcrunchify.com.tutorial:crunchify-tutorial:jar:1.0.0-SNAPSHOT:Thefollowingartifactscouldnotberesolved:javax.jms:jms:jar:1.1,com.sun.jdmk:jmxtools:jar:1.2.1,com.sun.jmx:jmxri:jar:1.2.1:Couldnottransferartifactjavax.jms:jms:jar:1.1from/tojava.net(https://maven-repository.dev.java.net/nonav/repository):Cannotaccesshttps://maven-repository.dev.java.net/nonav/repositorywithtypelegacyusingtheavailableconnectorfactories:BasicRepositoryConnectorFactory AfterdiggingfurtherIfoundthat,inmyJavaProjectIwasusing1.2.15log4jdependencies. 12345 log4j log4j 2.15.0 Bydefaultlog4j2.15.0versionaddsallabove3dependencies.Samefor zookeeper3.3.2version. Howtofixthisthispermanently? Therearetwooptions. Option-1. Justupgradelog4jandzookeepertolatestversion.log4j1.2.16andzookeeper3.4.9doesn’thavethesedependencies. Option-2. Addbelowexclusionscodetoyourproject’spom.xmlfile. Hereisacode: 1234567891011121314 com.sun.jmx jmxri com.sun.jdmk jmxtools javax.jms jms Letmeknowifyoustillfaceanyissue. JointheDiscussionIfyoulikedthisarticle,thenpleaseshareitonsocialmedia.Stillhaveanyquestionsaboutanarticle,leaveusacomment. Share: OtherPopularArticles... InJavaHowtoFindMaximumOccurrenceofWordsfromTextFile? Whatispom.xml(ProjectObjectModel)?Samplepom.xmlforyoutouseinyourDynamicWebProject(Java/J2EE) JavaSSLSocketwithTLS1.3andTLS_AES_128_GCM_SHA256CipherExample JavaLocalDate(),LocalDateTime(),ZonedDateTime(),Calendar()andDate()Tutorial HowtoGenerateRandomNumberinJavawithSomeVariations? HowtoBuildJavaProjectincludingallDependenciesUsingMaven?maven-resources,maven-dependencyandmaven-jarPlugins FooterTopTechCategories… TopBloggingCategories…



請為這篇文章評分?