简体   繁体   English

maven项目签入svn与本地jar

[英]maven project checkin in svn with local jar

I am working in a application which consume a webservice. 我正在使用一个使用Web服务的应用程序。 I generated the webservice client using axis2codegen. 我使用axis2codegen生成了webservice客户端。 Since it is generated code there are lot of duplicate codes exist. 由于它是生成代码,因此存在许多重复代码。 As per suggestion on code review we have to remove it and add it as jar. 根据代码审查的建议,我们必须删除它并将其添加为jar。 I created a jar and add to the local repository of the maven. 我创建了一个jar并添加到maven的本地存储库中。 But the problem is how can i check in the locally generateed jar to the svn, so that the user who check the project does not need to add it to the local repository manually as i did it. 但问题是如何检查本地生成的jar到svn,以便检查项目的用户不需要像我那样手动将其添加到本地存储库。 Thanks in advance 提前致谢

Storing the .jar files in subversion isn't really the "maven way". 在subversion中存储.jar文件并不是真正的“maven方式”。 You might want to consider setting up a corporate maven repository using something like nexus or artifactory and then deploy your .jar artifacts there instead. 您可能需要考虑使用nexus或ar​​tifactory之类的东西设置公司maven存储库,然后在那里部署.jar工件。

Once that's done you can distribute a corporate settings.xml file pointing to this repository (or include it in each projects pom.xml file) and you can then manage your generated code like any other maven dependency. 完成后,您可以分发指向此存储库的公司settings.xml文件(或将其包含在每个项目的pom.xml文件中),然后您可以像管理任何其他maven依赖项一样管理生成的代码。

HTH HTH

Don't commit jar into SVN : dependency management has introduced the concept of "artifact repository" separating binaries from sources: 不要将jar提交到SVN :依赖关系管理引入了“工件库”的概念,将二进制文件与源分开:

  • binary are saved into artifact repository 二进制文件保存到工件库中
  • source are saved into source code management repository 源被保存到源代码管理库中

In order to share the jar with your pears you should: 为了与你的梨分享罐子你应该:

  1. install the jar in a corporate maven repository like artifactory or nexus 将jar安装在像artifactorynexus这样的公司maven存储库中
  2. add a dependency to the jar in your project pom 在项目pom中为jar添加依赖项
  3. commit the pom into SVN 将pom提交到SVN
  4. tell to your pears to check out from SVN the updated pom 告诉你的梨从SVN核对更新的pom

You don't. 你没有。 In most circumstances you will use maven to deploy the project (the jar) to a repository manager (Nexus is by far the de facto for this). 在大多数情况下,您将使用maven将项目(jar)部署到存储库管理器(Nexus到目前为止是事实上的)。

Next you configure your co-workers to proxy their maven requests to yuor Nexus installation which itself "knows" about maven Central, thus providing a single point of presence for everything both from the outside world and published internally. 接下来,您将您的同事配置为将他们的maven请求代理到yuor Nexus安装,该安装本身“了解”maven Central,从而为来自外部世界和内部发布的所有内容提供单点存在。

It's usually a good idea for another service such as Jenkins to be paired with a release plugin to execute the maven release procedure on your before, and for it to publish the artefacts too. 对于像詹金斯这样的其他服务与一个发布插件配对来执行之前的maven发布过程通常是一个好主意,并且它也可以发布这些文章。

Here we have a long list of maven projects that our Jenkins installation builds upon noticing an SVN change. 在这里,我们有一长串maven项目,我们的Jenkins安装是在注意到SVN更改的基础上构建的。 Upon the click of a button within Jenkins for the project, it can perform a complete build and release to our Nexus repository the project's newly built-and-tested artefacts. 点击Jenkins中的项目按钮后,它可以执行完整的构建并向我们的Nexus存储库发布项目新构建和测试的文物。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM