Maven: Is it possible to upload a set of 3rd party jars to repository, which can then be referenced as a single dependency?

前端 未结 2 1117
不知归路
不知归路 2021-01-17 03:56

We are using an internal Nexus Repository for third party jars which are dependencies in our applications.

I am starting a new project, and have a set of 4 third par

相关标签:
2条回答
  • 2021-01-17 04:29

    As you refer to in your comment, you can create a pom file of your own that depends on the four jars you talk about. Then, release this to your local nexus. Once this is done, you can depend on it as a pom dependency, which will bring in the four libraries you want.

    0 讨论(0)
  • 2021-01-17 04:30

    I would use a custom property in the pom file to hold the version number, so that you can change the version once for all the dependencies. For example:

    <properties>
        <spring.version>3.1.2.RELEASE</spring.version>
    </properties>
    
    <dependencies>
    
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
    
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
    
    </dependencies>
    
    0 讨论(0)
提交回复
热议问题