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

前端 未结 24 2585
萌比男神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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-22 02:02

    A quick&dirty batch solution (based on Alex's answer):

    libs.bat

    @ECHO OFF
    FOR %%I IN (*.jar) DO (
    echo ^
    echo ^local.dummy^
    echo ^%%I^
    echo ^0.0.1^
    echo ^system^
    echo ^${project.basedir}/lib/%%I^
    echo ^
    )
    

    Execute it like this: libs.bat > libs.txt. Then open libs.txt and copy its content as dependencies.

    In my case, I only needed the libraries to compile my code, and this solution was the best for that purpose.

提交回复
热议问题