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

前端 未结 24 2582
萌比男神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 02:10

    If you want a quick and dirty solution, you can do the following (though I do not recommend this for anything except test projects, maven will complain in length that this is not proper).

    Add a dependency entry for each jar file you need, preferably with a perl script or something similar and copy/paste that into your pom file.

    #! /usr/bin/perl
    
    foreach my $n (@ARGV) {
    
        $n=~s@.*/@@;
    
        print "
        local.dummy
        $n
        0.0.1
        system
        \${project.basedir}/lib/$n
    
    ";
    

提交回复
热议问题