今天下午在搭建SpringMVC,然后使用了一段时间没用过的Maven构建。


首先是回顾了下Maven,但是照着网上写的一个写个例子程序一直报ClassNotFoundException错误。

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>asdd</groupId>
  <artifactId>wsadsfasdf</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
     <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.3.2</version>
        </dependency>
    </dependencies>
    
</project>

import org.apache.commons.lang3.StringUtils;

public class CheckNumeric {
   public static void main(String[] args) {
       String text = "0123";
       boolean result = StringUtils.isNumeric(text);
       System.out.println(text + " is a numeric? " + result);
   }
}

一直报:ClassNotFoundException异常。


明明Maven Dependencies下面已经有commons-lang3-3.3.2.jar,但是还是找不到类。重新配置maven,重启电脑都试过。就不知道问题出在哪里。

后面去找maven下载的目录,发现了奇怪的事情。jar包没下到,而是有commons-lang3-3.3.2.jar.lastUpdated这样的文件,瞬间蛋碎。

删除文件夹后,重新启动eclipse,这次成功下载到jar包。正常运行。


不知道踩什么坑了。

GitHub 加速计划 / ma / maven
36
3
下载
Maven: Apache Maven是一个开源的项目管理和构建工具,主要用于Java项目。适合需要自动化项目构建和依赖管理的开发者。特点包括约定优于配置、易于使用和社区驱动。
最近提交(Master分支:3 个月前 )
1db41bbe Bumps [org.junit:junit-bom](https://github.com/junit-team/junit-framework) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r6.0.1...r6.0.2) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-version: 6.0.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 10 小时前
cb7188d7 Use latest Mimir 0.11.2 + mirror feature. CI is now redirected to Google US Mirror. We identified 3 problems affected by unstable Central (fails the CI runs if any of these get 4xx/5xx): * wrapper - fixed by using alt URL * Mimir extension loading from Central (not solved by this PR) * two UTs `RequestTraceTest` and `TestApiStandalone` going directly to Central (not solved by this PR) 1 天前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐