maven install and deploy 3rd party dependencies with simple command line

后端 未结 3 977
独厮守ぢ
独厮守ぢ 2021-02-09 14:38

We have a number of third party dependencies that aren\'t hosted anywhere. For each of these we have a jar file that we\'d like to be able to install and/or deploy to our reposi

3条回答
  •  天涯浪人
    2021-02-09 14:57

    When Maven is missing a dependency, it will give you an error in it's output that contains the command line to issue to add the jar to a remote repository. That command line will automatically create a POM for you and upload the two together. Is that not sufficient for your needs?

    Using this facility, if I know that I have a dependency with no remote repository representation, I usually just go ahead and define it in my build with the GAV that I want, run the build once, then look at the build errors. Copy out the command for the deployment, then run that command. You'll want to make sure that you have the elements set up properly in the parent POM plus also set up corresponding elements in your settings.xml with the repository upload password. Other than that, you should be good to go.

    I would add that you should check out Nexus before getting to far. It's worth the hassle to set up now! :-)

提交回复
热议问题