Home  >  Q&A  >  body text

java - 想使用别人项目中maven引入的jar包,就是那个.class文件,要怎么操作?

自己网上下载的jar包好像比较旧的版本,看别人maven导入的同样jar包有一些新方法就想用别人的那个.class文件,不过好像不可以直接复制粘贴过来

怪我咯怪我咯2744 days ago632

reply all(3)I'll reply

  • 迷茫

    迷茫2017-04-18 10:51:50

    If you use maven to manage it, the jars you reference are either in your local warehouse or in the central warehouse. You can add his jar to your local repository and then reference it. If you quote it directly, you will search it from the central warehouse (that is, there is a maintained warehouse in the network, and all versions of jars are in it). If you don’t have it, you won’t find it.

    reply
    0
  • 阿神

    阿神2017-04-18 10:51:50

    Add the jar package you introduced to pom.xml in the maven project,

    <dependency> 
    <groupId>javax.servlet</groupId> 
    <artifactId>servlet-api</artifactId> 
             <version>1.1.1</version> 
    </dependency> 
    
    这样就可以引入别的jar包,可以通过.class文件名,去网上找寻其中maven仓库的名称

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:51:50

    Since Maven is used, wouldn’t it be enough to configure the dependencies in the pom and make it consistent with the jar package version used by others?

    reply
    0
  • Cancelreply