Maven: How to include jars, which are not available in reps into a J2EE project?

后端 未结 10 1078
失恋的感觉
失恋的感觉 2020-11-28 18:17

in my J2EE project I\'ve a couple of dependencies, which are not available in any Maven repository, because they\'re proprietary libraries. These libraries need to be availa

10条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 18:45

    Create a repository folder under your project. Let's take

    ${project.basedir}/src/main/resources/repo
    

    Then, install your custom jar to this repo:

    mvn install:install-file -Dfile=[FILE_PATH] \
    -DgroupId=[GROUP] -DartifactId=[ARTIFACT] -Dversion=[VERS] \ 
    -Dpackaging=jar -DlocalRepositoryPath=[REPO_DIR]
    

    Lastly, add the following repo and dependency definitions to the projects pom.xml:

    
        
            project-repo
            file://${project.basedir}/src/main/resources/repo
        
    
    
        
        
            [GROUP]
            [ARTIFACT]
            [VERS]
        
    
    

提交回复
热议问题