Servlet *** is currently unavailable/java.lang.ClassNotFoundException

文章详细介绍了使用Eclipse或MyEclipse时遇到的Web项目自动编译问题,包括项目缺少class文件的情况,并提供了检查和解决方法,避免因小错误导致项目运行困难。
 

本来可以运行的web项目,重启eclipse后竟然不能正常运行了,只能显示静态网页,不能与后台进行交互,错误提示如下:

org.apache.catalina.core.StandardWrapperValve invoke信息: Servlet YsxmglF is currently unavailable

Allocate exception for servlet YsxmglF  java.lang.ClassNotFoundException: controller.YsxmglF

所以就按照这个提示去国内外的网站找各种解决办法,但最终还是没找到,无奈之下就去检查\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\中的项目文件,发现我的项目中的WEB-INF\ classes里面是竟然是空的,也就是所有java文件都没有被编译,这也就是为什么servlet不能用,所以赶紧去网上找到解决方法,如下:

有时候用Eclipse或者MyEclipse的时候,发现不能自动编译,web工程下面缺少class文件!

第一个可能是你的自动编译没打开:project-build automatically;第二个要注意你的工程项目上有没有打小红叉,项目报错时,eclipse是不自动编译的。你可以检查一下是否有些类出错,或是检查一下“构建路径”是否完整,特别是从换机子调试程序时,有些导入jar包的路径不对。

这才恍然大悟,原来上次我在修改相关java代码后导致一些java文件出错,前面出现小红叉叉,由于当时项目可以运行,想着这些有错的java文件我暂时不用,就没管,所以导致后来遇到的这些麻烦。

看来以后修改代码得改的彻底些,不能大意呀!

PS D:\Desktop\wenti\2222> mvn dependency:get -DrepoUrl=https://huggingface.github.io/maven-repo ` >> -DgroupId=com.huggingface.tokenizers ` >> -DartifactId=tokenizers ` >> -Dversion=0.14.1 ` >> -Dclassifier=win-x86_64 [INFO] Scanning for projects... [INFO] [INFO] ---------------< com.vectorsearch:vector-search-system >---------------- [INFO] Building Vector Search System 1.0.0 [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- dependency:3.1.2:get (default-cli) @ vector-search-system --- Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/reporting/maven-reporting-impl/3.0.0/maven-reporting-impl-3.0.0.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/reporting/maven-reporting-impl/3.0.0/maven-reporting-impl-3.0.0.pom (7.6 kB at 12 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/shared/maven-shared-utils/3.2.0/maven-shared-utils-3.2.0.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/shared/maven-shared-utils/3.2.0/maven-shared-utils-3.2.0.pom (4.9 kB at 58 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-sink-api/1.7/doxia-sink-api-1.7.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-sink-api/1.7/doxia-sink-api-1.7.pom (1.5 kB at 16 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia/1.7/doxia-1.7.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia/1.7/doxia-1.7.pom (15 kB at 153 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-logging-api/1.7/doxia-logging-api-1.7.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-logging-api/1.7/doxia-logging-api-1.7.pom (1.5 kB at 17 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-decoration-model/1.7.4/doxia-decoration-model-1.7.4.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-decoration-model/1.7.4/doxia-decoration-model-1.7.4.pom (3.4 kB at 24 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-sitetools/1.7.4/doxia-sitetools-1.7.4.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-sitetools/1.7.4/doxia-sitetools-1.7.4.pom (14 kB at 112 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-core/1.7/doxia-core-1.7.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-core/1.7/doxia-core-1.7.pom (4.1 kB at 44 kB/s) [INFO] Artifact org.apache.httpcomponents:httpclient:pom:4.0.2 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.httpcomponents:httpclient:pom:4.0.2 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpclient/4.0.2/httpclient-4.0.2.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpclient/4.0.2/httpclient-4.0.2.pom (0 B at 0 B/s) [INFO] Artifact org.apache.httpcomponents:httpcomponents-client:pom:4.0.2 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.httpcomponents:httpcomponents-client:pom:4.0.2 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcomponents-client/4.0.2/httpcomponents-client-4.0.2.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcomponents-client/4.0.2/httpcomponents-client-4.0.2.pom (0 B at 0 B/s) [INFO] Artifact org.apache.httpcomponents:project:pom:4.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.httpcomponents:project:pom:4.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/project/4.1/project-4.1.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/project/4.1/project-4.1.pom (0 B at 0 B/s) [INFO] Artifact org.apache.httpcomponents:httpcore:pom:4.0.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.httpcomponents:httpcore:pom:4.0.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.pom (0 B at 0 B/s) [INFO] Artifact org.apache.httpcomponents:httpcomponents-core:pom:4.0.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.httpcomponents:httpcomponents-core:pom:4.0.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcomponents-core/4.0.1/httpcomponents-core-4.0.1.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcomponents-core/4.0.1/httpcomponents-core-4.0.1.pom (0 B at 0 B/s) [INFO] Artifact org.apache.httpcomponents:project:pom:4.0 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.httpcomponents:project:pom:4.0 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/project/4.0/project-4.0.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/project/4.0/project-4.0.pom (0 B at 0 B/s) [INFO] Artifact commons-codec:commons-codec:pom:1.3 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact commons-codec:commons-codec:pom:1.3 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/commons-codec/commons-codec/1.3/commons-codec-1.3.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/commons-codec/commons-codec/1.3/commons-codec-1.3.pom (0 B at 0 B/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/xmlunit/xmlunit/1.5/xmlunit-1.5.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/xmlunit/xmlunit/1.5/xmlunit-1.5.pom (3.0 kB at 27 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-site-renderer/1.7.4/doxia-site-renderer-1.7.4.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-site-renderer/1.7.4/doxia-site-renderer-1.7.4.pom (6.7 kB at 63 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-skin-model/1.7.4/doxia-skin-model-1.7.4.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-skin-model/1.7.4/doxia-skin-model-1.7.4.pom (3.0 kB at 29 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-module-xhtml/1.7/doxia-module-xhtml-1.7.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-module-xhtml/1.7/doxia-module-xhtml-1.7.pom (1.6 kB at 21 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-modules/1.7/doxia-modules-1.7.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-modules/1.7/doxia-modules-1.7.pom (2.6 kB at 28 kB/s) [INFO] Artifact javax.servlet:servlet-api:pom:2.3 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact javax.servlet:servlet-api:pom:2.3 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/javax/servlet/servlet-api/2.3/servlet-api-2.3.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/javax/servlet/servlet-api/2.3/servlet-api-2.3.pom (0 B at 0 B/s) [INFO] Artifact commons-validator:commons-validator:pom:1.3.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact commons-validator:commons-validator:pom:1.3.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.pom (0 B at 0 B/s) [INFO] Artifact sslext:sslext:pom:1.2-0 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact sslext:sslext:pom:1.2-0 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/sslext/sslext/1.2-0/sslext-1.2-0.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/sslext/sslext/1.2-0/sslext-1.2-0.pom (0 B at 0 B/s) [INFO] Artifact org.apache.struts:struts-core:pom:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-core:pom:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.pom (0 B at 0 B/s) [INFO] Artifact org.apache.struts:struts-parent:pom:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-parent:pom:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-parent/1.3.8/struts-parent-1.3.8.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-parent/1.3.8/struts-parent-1.3.8.pom (0 B at 0 B/s) [INFO] Artifact org.apache.struts:struts-master:pom:4 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-master:pom:4 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-master/4/struts-master-4.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-master/4/struts-master-4.pom (0 B at 0 B/s) [INFO] Artifact org.apache:apache:pom:2 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache:apache:pom:2 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/apache/2/apache-2.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/apache/2/apache-2.pom (0 B at 0 B/s) [INFO] Artifact antlr:antlr:pom:2.7.2 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact antlr:antlr:pom:2.7.2 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/antlr/antlr/2.7.2/antlr-2.7.2.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/antlr/antlr/2.7.2/antlr-2.7.2.pom (0 B at 0 B/s) [INFO] Artifact org.apache.struts:struts-taglib:pom:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-taglib:pom:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.pom (0 B at 0 B/s) [INFO] Artifact org.apache.struts:struts-tiles:pom:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-tiles:pom:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.pom (0 B at 0 B/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-sink-api/1.9/doxia-sink-api-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-sink-api/1.9/doxia-sink-api-1.9.pom (1.6 kB at 3.9 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia/1.9/doxia-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia/1.9/doxia-1.9.pom (19 kB at 58 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-logging-api/1.9/doxia-logging-api-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-logging-api/1.9/doxia-logging-api-1.9.pom (1.6 kB at 6.1 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/codehaus/plexus/plexus-container-default/1.7.1/plexus-container-default-1.7.1.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/codehaus/plexus/plexus-container-default/1.7.1/plexus-container-default-1.7.1.pom (2.8 kB at 17 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.pom (3.8 kB at 23 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-core/1.9/doxia-core-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-core/1.9/doxia-core-1.9.pom (4.4 kB at 11 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.pom (23 kB at 180 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/commons/commons-parent/41/commons-parent-41.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/commons/commons-parent/41/commons-parent-41.pom (65 kB at 432 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpclient/4.5.8/httpclient-4.5.8.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpclient/4.5.8/httpclient-4.5.8.pom (6.6 kB at 10 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcomponents-client/4.5.8/httpcomponents-client-4.5.8.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcomponents-client/4.5.8/httpcomponents-client-4.5.8.pom (16 kB at 39 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcore/4.4.11/httpcore-4.4.11.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcore/4.4.11/httpcore-4.4.11.pom (5.2 kB at 8.1 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcomponents-core/4.4.11/httpcomponents-core-4.4.11.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcomponents-core/4.4.11/httpcomponents-core-4.4.11.pom (13 kB at 23 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-site-renderer/1.9/doxia-site-renderer-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-site-renderer/1.9/doxia-site-renderer-1.9.pom (6.7 kB at 12 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-sitetools/1.9/doxia-sitetools-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-sitetools/1.9/doxia-sitetools-1.9.pom (16 kB at 16 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-decoration-model/1.9/doxia-decoration-model-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-decoration-model/1.9/doxia-decoration-model-1.9.pom (3.4 kB at 5.5 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-skin-model/1.9/doxia-skin-model-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-skin-model/1.9/doxia-skin-model-1.9.pom (3.0 kB at 5.8 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-module-xhtml/1.9/doxia-module-xhtml-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-module-xhtml/1.9/doxia-module-xhtml-1.9.pom (2.0 kB at 12 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-modules/1.9/doxia-modules-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-modules/1.9/doxia-modules-1.9.pom (2.7 kB at 15 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-module-xhtml5/1.9/doxia-module-xhtml5-1.9.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-module-xhtml5/1.9/doxia-module-xhtml5-1.9.pom (2.0 kB at 4.9 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/shared/maven-dependency-analyzer/1.11.1/maven-dependency-analyzer-1.11.1.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/shared/maven-dependency-analyzer/1.11.1/maven-dependency-analyzer-1.11.1.pom (6.7 kB at 10 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/ow2/asm/asm/7.3.1/asm-7.3.1.pom Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/ow2/asm/asm/7.3.1/asm-7.3.1.pom (2.9 kB at 22 kB/s) [INFO] Artifact commons-validator:commons-validator:jar:1.3.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact sslext:sslext:jar:1.2-0 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-core:jar:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact antlr:antlr:jar:2.7.2 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-taglib:jar:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-tiles:jar:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact commons-validator:commons-validator:jar:1.3.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact sslext:sslext:jar:1.2-0 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-core:jar:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact antlr:antlr:jar:2.7.2 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-taglib:jar:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] [INFO] Artifact org.apache.struts:struts-tiles:jar:1.3.8 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [nexus-aliyun (https://maven.aliyun.com/repository/central, default, releases), apache.snapshots (https://repository.apache.org/snapshots, default, snapshots)] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/reporting/maven-reporting-impl/3.0.0/maven-reporting-impl-3.0.0.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/reporting/maven-reporting-impl/3.0.0/maven-reporting-impl-3.0.0.jar (18 kB at 128 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-decoration-model/1.7.4/doxia-decoration-model-1.7.4.jar Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-logging-api/1.9/doxia-logging-api-1.9.jar Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/codehaus/plexus/plexus-container-default/1.7.1/plexus-container-default-1.7.1.jar Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-sink-api/1.9/doxia-sink-api-1.9.jar Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-core/1.9/doxia-core-1.9.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-decoration-model/1.7.4/doxia-decoration-model-1.7.4.jar (61 kB at 379 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar (480 kB at 1.5 MB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpclient/4.5.8/httpclient-4.5.8.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-core/1.9/doxia-core-1.9.jar (219 kB at 469 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcore/4.4.11/httpcore-4.4.11.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpcore/4.4.11/httpcore-4.4.11.jar (327 kB at 547 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-site-renderer/1.9/doxia-site-renderer-1.9.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-sink-api/1.9/doxia-sink-api-1.9.jar (12 kB at 19 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-skin-model/1.9/doxia-skin-model-1.9.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-logging-api/1.9/doxia-logging-api-1.9.jar (12 kB at 16 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-module-xhtml/1.9/doxia-module-xhtml-1.9.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/httpcomponents/httpclient/4.5.8/httpclient-4.5.8.jar (772 kB at 978 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-module-xhtml5/1.9/doxia-module-xhtml5-1.9.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/codehaus/plexus/plexus-container-default/1.7.1/plexus-container-default-1.7.1.jar (231 kB at 272 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar (0 B at 0 B/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/sslext/sslext/1.2-0/sslext-1.2-0.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/sslext/sslext/1.2-0/sslext-1.2-0.jar (0 B at 0 B/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar (0 B at 0 B/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/antlr/antlr/2.7.2/antlr-2.7.2.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/antlr/antlr/2.7.2/antlr-2.7.2.jar (0 B at 0 B/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar (0 B at 0 B/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar (0 B at 0 B/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/shared/maven-dependency-analyzer/1.11.1/maven-dependency-analyzer-1.11.1.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-module-xhtml/1.9/doxia-module-xhtml-1.9.jar (18 kB at 16 kB/s) Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/org/ow2/asm/asm/7.3.1/asm-7.3.1.jar Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-skin-model/1.9/doxia-skin-model-1.9.jar (17 kB at 13 kB/s) Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/ow2/asm/asm/7.3.1/asm-7.3.1.jar (122 kB at 94 kB/s) Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-site-renderer/1.9/doxia-site-renderer-1.9.jar (66 kB at 51 kB/s) Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/doxia/doxia-module-xhtml5/1.9/doxia-module-xhtml5-1.9.jar (18 kB at 13 kB/s) Downloaded from nexus-aliyun: https://maven.aliyun.com/repository/central/org/apache/maven/shared/maven-dependency-analyzer/1.11.1/maven-dependency-analyzer-1.11.1.jar (35 kB at 20 kB/s) [INFO] Resolving com:tokenizers:jar:win-x86_64:0 with transitive dependencies Downloading from aliyunmaven: https://maven.aliyun.com/repository/public/com/tokenizers/0/tokenizers-0.pom Downloading from huggingface-maven: https://huggingface.github.io/maven-repo/com/tokenizers/0/tokenizers-0.pom Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/com/tokenizers/0/tokenizers-0.pom [WARNING] The POM for com:tokenizers:jar:win-x86_64:0 is missing, no dependency information available Downloading from aliyunmaven: https://maven.aliyun.com/repository/public/com/tokenizers/0/tokenizers-0-win-x86_64.jar Downloading from huggingface-maven: https://huggingface.github.io/maven-repo/com/tokenizers/0/tokenizers-0-win-x86_64.jar Downloading from nexus-aliyun: https://maven.aliyun.com/repository/central/com/tokenizers/0/tokenizers-0-win-x86_64.jar [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Skipping Vector Search System [INFO] This project has been banned from the build due to previous failures. [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 22.045 s [INFO] Finished at: 2025-11-03T15:17:11+08:00 [INFO] ------------------------------------------------------------------------ [WARNING] esolutionException: The following artifacts could not be resolved: com:tokenizers:jar:win-x86_64:0 (absent): Could not find artifact com:tokenizers:jar:win-x86_64:0 in aliyunmaven (https://maven.aliyun.com/repository/public) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
最新发布
11-04
<think>我们正在解决使用 `mvn dependency:get` 命令下载特定依赖时出现的错误。根据用户描述,命令中指定了 `classifier=win-x86_64`,但出现了关于 POM 文件缺失和找不到工件的错误。 错误信息示例: The POM for com:tokenizers:jar:win-x86_64:0 is missing Could not find artifact 分析: 1. 错误中提到的工件坐标是 `com:tokenizers:jar:win-x86_64:0`,这显然与我们期望的坐标 `com.huggingface.tokenizers:tokenizers:0.14.1:win-x86_64` 不一致。 - 注意:用户命令中使用的 groupId 是 `com.huggingface.tokenizers`,artifactId 是 `tokenizers`,版本是 `0.14.1`,分类器是 `win-x86_64`。 - 但是错误信息中 groupId 变成了 `com`,artifactId 变成了 `tokenizers`,版本变成了 `0`。这可能是由于命令参数传递错误或解析问题。 2. 可能的错误原因: a) Maven 命令参数传递错误:特别是当参数值包含特殊字符或空格时,可能会被错误解析。 b) 仓库中确实不存在该分类器的依赖项:但根据之前的回答,我们应该使用 `win-x86_64` 分类器,并且仓库结构要求我们使用分类器。 3. 正确的命令应该是: mvn dependency:get \ -DgroupId=com.huggingface.tokenizers \ -DartifactId=tokenizers \ -Dversion=0.14.1 \ -Dclassifier=win-x86_64 \ -DrepoUrl=https://huggingface.github.io/maven-repo 4. 另外,错误信息中的版本变成了 `0`,这可能是由于版本号参数没有被正确传递,或者 Maven 在解析时出了问题。 解决方案: 1. 检查命令语法:确保在 PowerShell 中使用正确的转义和引号。由于 PowerShell 中参数传递的特殊性,建议使用双引号将每个参数的值包裹起来,并使用反引号(`)作为换行符。 2. 验证仓库中是否存在该文件: 我们可以通过直接访问 URL 来验证文件是否存在: - POM 文件:https://huggingface.github.io/maven-repo/com/huggingface/tokenizers/tokenizers/0.14.1/tokenizers-0.14.1.pom - JAR 文件(带分类器):https://huggingface.github.io/maven-repo/com/huggingface/tokenizers/tokenizers/0.14.1/tokenizers-0.14.1-win-x86_64.jar 3. 如果文件存在,那么可能是命令执行的问题。在 PowerShell 中,由于参数中的点号(.)可能会被解释,我们可以尝试用引号将每个参数的值包围起来。 4. 注意:在 Maven 中,分类器(classifier)是通过 `-Dclassifier` 指定的,但是必须同时指定类型(type),默认类型是 `jar`,所以我们不需要指定类型。 5. 如果仍然失败,可以尝试将命令写在一行,避免换行符带来的问题。 具体步骤: 步骤1:验证仓库文件是否存在 - 在浏览器中打开 POM 文件的 URL:https://huggingface.github.io/maven-repo/com/huggingface/tokenizers/tokenizers/0.14.1/tokenizers-0.14.1.pom 应该能看到 XML 内容。 - 同样打开 JAR 文件的 URL:https://huggingface.github.io/maven-repo/com/huggingface/tokenizers/tokenizers/0.14.1/tokenizers-0.14.1-win-x86_64.jar 应该能下载 JAR 文件。 步骤2:在 PowerShell 中执行正确的命令格式 由于 PowerShell 中参数传递的特殊性,我们可以这样写命令(注意使用双引号包裹每个参数值,并使用反引号换行): ```powershell mvn dependency:get ` -DgroupId="com.huggingface.tokenizers" ` -DartifactId="tokenizers" ` -Dversion="0.14.1" ` -Dclassifier="win-x86_64" ` -DrepoUrl="https://huggingface.github.io/maven-repo" ``` 或者写在一行: ```powershell mvn dependency:get -DgroupId="com.huggingface.tokenizers" -DartifactId="tokenizers" -Dversion="0.14.1" -Dclassifier="win-x86_64" -DrepoUrl="https://huggingface.github.io/maven-repo" ``` 步骤3:如果上述命令仍然失败,可以尝试添加 `-Dpackaging=jar` 来明确指定打包类型: ```powershell mvn dependency:get ` -DgroupId="com.huggingface.tokenizers" ` -DartifactId="tokenizers" ` -Dversion="0.14.1" ` -Dclassifier="win-x86_64" ` -Dpackaging="jar" ` -DrepoUrl="https://huggingface.github.io/maven-repo" ``` 步骤4:如果还是不行,可以尝试使用 Maven 的调试模式(加上 `-X` 参数)来查看详细的执行过程: ```powershell mvn -X dependency:get ...(同上参数) ``` 步骤5:检查 Maven 的 settings.xml 配置,看看是否有镜像或代理设置导致无法访问该仓库。 步骤6:如果仓库需要认证,但 Hugging Face 仓库不需要,所以不考虑认证问题。 另外,错误信息中出现了 `com:tokenizers`,这可能是由于 groupId 没有正确传递,导致 Maven 将 `com.huggingface.tokenizers` 截断了?所以使用双引号包裹 groupId 尤为重要。 补充:在 Maven 中,坐标的完整格式是: <groupId>:<artifactId>[:<packaging>[:<classifier>]]:<version> 在 `dependency:get` 目标中,我们通过参数分别指定,因此必须确保每个部分都正确。 如果上述步骤都无效,可以尝试使用 Maven 的 `install:install-file` 命令手动安装已经下载好的 JAR 文件(前提是已经通过其他方式下载了 JAR 文件和 POM 文件)。 手动安装示例(如果已经下载了 JAR 和 POM): ```powershell mvn install:install-file ` -DgroupId="com.huggingface.tokenizers" ` -DartifactId="tokenizers" ` -Dversion="0.14.1" ` -Dclassifier="win-x86_64" ` -Dpackaging="jar" ` -Dfile="tokenizers-0.14.1-win-x86_64.jar" ` -DpomFile="tokenizers-0.14.1.pom" ``` 但首先需要下载这两个文件: ```powershell # 下载 POM Invoke-WebRequest -Uri "https://huggingface.github.io/maven-repo/com/huggingface/tokenizers/tokenizers/0.14.1/tokenizers-0.14.1.pom" -OutFile "tokenizers-0.14.1.pom" # 下载 JAR(带分类器) Invoke-WebRequest -Uri "https://huggingface.github.io/maven-repo/com/huggingface/tokenizers/tokenizers/0.14.1/tokenizers-0.14.1-win-x86_64.jar" -OutFile "tokenizers-0.14.1-win-x86_64.jar" ``` 然后运行安装命令。 总结:优先尝试正确的命令格式,如果不行则考虑手动下载并安装。 其他注意事项:确保网络可以访问 `https://huggingface.github.io`,并且没有防火墙阻止。 如果用户在执行上述步骤时遇到新的问题,可以根据具体情况进行调整。 相关问题: 1. 如何解决 Maven 依赖下载中的认证问题? 2. 如何配置 Maven 使用镜像仓库? 3. 如何使用 Maven 手动安装本地 JAR 文件? </think>### 解决 `mvn dependency:get` 下载 Hugging Face Tokenizers 依赖的错误 #### 问题分析 您遇到的错误 `The POM for com:tokenizers:jar:win-x86_64:0 is missing` 和 `Could not find artifact` 通常由以下原因导致: 1. **坐标格式错误**:Maven依赖坐标格式应为 $( \text{groupId}:\text{artifactId}:\text{version}:\text{classifier} )$,但命令中可能缺少关键元素 2. **仓库配置缺失**:未正确指定自定义仓库 URL 3. **依赖元数据缺失**:Hugging Face 仓库未提供标准 POM 文件 4. **转义问题**:PowerShell 中特殊字符(如 `:`)需要特殊处理 #### 解决方案 ##### 方法 1:完整坐标格式(推荐) ```powershell mvn dependency:get ` -DgroupId=com.huggingface.tokenizers ` -DartifactId=tokenizers ` -Dversion=0.14.1 ` -Dclassifier=win-x86_64 ` -DremoteRepositories=https://huggingface.github.io/maven-repo ` -Dtransitive=false ``` 关键改进: - 显式指定 `classifier` 参数 - 使用 `-DremoteRepositories` 替代 `-DrepoUrl` - $( \text{-Dtransitive=false} )$ 避免递归解析依赖 ##### 方法 2:手动安装(当 POM 缺失时) 1. **下载 JAR 文件**: ```powershell $url = "https://huggingface.github.io/maven-repo/com/huggingface/tokenizers/0.14.1/tokenizers-0.14.1-win-x86_64.jar" Invoke-WebRequest -Uri $url -OutFile "tokenizers-0.14.1-win-x86_64.jar" ``` 2. **手动安装到本地仓库**: ```powershell mvn install:install-file ` -DgroupId=com.huggingface.tokenizers ` -DartifactId=tokenizers ` -Dversion=0.14.1 ` -Dclassifier=win-x86_64 ` -Dpackaging=jar ` -Dfile="tokenizers-0.14.1-win-x86_64.jar" ``` ##### 方法 3:添加仓库声明(长期解决方案) 在 `pom.xml` 中添加仓库配置: ```xml <repositories> <repository> <id>huggingface-maven</id> <url>https://huggingface.github.io/maven-repo</url> <releases> <enabled>true</enabled> </releases> </repository> </repositories> <dependencies> <dependency> <groupId>com.huggingface.tokenizers</groupId> <artifactId>tokenizers</artifactId> <version>0.14.1</version> <classifier>win-x86_64</classifier> </dependency> </dependencies> ``` #### 技术原理 Maven 依赖解析遵循标准路径格式: $$ \frac{\text{groupId.replace('.', '/')}}{\text{artifactId}}{\text{version}} {\text{artifactId}} {\text{version}} {\text{classifier?}} $$ 当使用自定义仓库时,Maven 会检查以下文件: 1. `artifactId-version.pom` → 元数据文件 2. `artifactId-version-classifier.jar` → 二进制文件 Hugging Face 仓库仅提供 JAR 文件,不包含标准 POM,导致 `dependency:get` 失败[^1]。 #### 验证安装 ```powershell # 检查本地仓库 ls ~/.m2/repository/com/huggingface/tokenizers/0.14.1/ # 验证依赖树 mvn dependency:tree -Dincludes=com.huggingface.tokenizers ``` 应输出: ``` [INFO] \- com.huggingface.tokenizers:tokenizers:jar:win-x86_64:0.14.1 ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值