Is there are way to install maven dependencies before maven attempts to resolve them?

后端 未结 4 834
孤街浪徒
孤街浪徒 2020-12-10 11:06

I have to unpack some dependencies from a remote location and install them locally.

I successfully get them (using the antrun plugin) and install them (using the ins

4条回答
  •  我在风中等你
    2020-12-10 11:46

    You can try the system scope in dependency and add systemPath:

    
        junit
        junit
        4.0
        system
        ${project.basedir}/lib/myhackedjunit-4.0.jar
    
    

    The system scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.

    The systemPath is used only if the the dependency scope is system. The path must be absolute. Since it is assumed that system scope dependencies are installed a prior, Maven will not check the repositories for the project, but instead checks to ensure that the file exists.

提交回复
热议问题