how to add external jar to maven webapp project

后端 未结 7 793
清歌不尽
清歌不尽 2020-12-31 12:26

I have a Spring roo project (basically a maven project). I want to add dropbox sdk to the project, problem is it\'s not in maven. I added the following files



        
7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-31 13:12

    I finally found a neat solution, which is a lot easier to implement. You add an in-project repository inside the java project and link to it in the pom.

    You add an in-project repository in maven like this:

    
        in-project
            In Project Repo
            file://${project.basedir}/libs
    
    

    Then create a folder structure in the root folder of your project that looks something like this

    /groupId/artifactId/version/artifactId-version.jar
    

    and add the dependency as you would normally do.

    This approach has the least amount of code and work required, and if that library ever gets add into a maven repository you can always remove your in-project repository.

    http://bit.ly/OGVHSN

提交回复
热议问题