Can I add jars to maven 2 build classpath without installing them?

前端 未结 24 2596
萌比男神i
萌比男神i 2020-11-22 01:41

Maven2 is driving me crazy during the experimentation / quick and dirty mock-up phase of development.

I have a pom.xml file that defines the dependenc

24条回答
  •  心在旅途
    2020-11-22 01:53

    I found another way to do this, see here from a Heroku post

    To summarize (sorry about some copy & paste)

    • Create a repo directory under your root folder:
    yourproject
    +- pom.xml
    +- src
    +- repo
    
    • Run this to install the jar to your local repo directory
    mvn deploy:deploy-file -Durl=file:///path/to/yourproject/repo/ -Dfile=mylib-1.0.jar -DgroupId=com.example -DartifactId=mylib -Dpackaging=jar -Dversion=1.0
    
    • Add this your pom.xml:
    
        
        
            project.local
            project
            file:${project.basedir}/repo
        
    
    
    
    
        com.example
        mylib
        1.0  
    
    

提交回复
热议问题