English 中文(简体)
(Maven+Eclipse)How 每个开发商在当地处理jar?
原标题:(Maven+Eclipse)How each developer handle the jars locally?

I m kinda newbie to Maven and Continuous Integration, so excuse my trivial questions below In our project we intend to introduce the Continuous Integration through performing automated daily builds on our development integration server using Maven and hudson

我们根据一个单独的项目,在SCM的所有支柱(内部、商业和营地;第三党)中检查我们的项目,迫使网络项目依赖该项目,以便该项目能够用剪辑,然后出口欧洲复兴开发银行。

my question is, how will each developer locally on his machine compile the project now ?, should we remove the jars project at all from scm ? If yes : does this mean that each developer must refer to the enterprise s maven repository from within eclipse so that the project can compile ? and in that case there will be extreme NW overhead ?? If No : there might be a conflict between jars on scm and those in maven repository

another question that is related to the above one, will each developer have his own maven local repository on his machine ? final question, shall each developer compile the code using maven (through M2Eclipse) or using eclipse compiler as normal ?

感谢:

最佳回答

我们认为,我们这样做的方式是非常常见的。

  • We have our own installation of a repository manager, for example Nexus, installed at some machine in the intranet, available for all developers to use
  • Jars would not be in the SCM, but stored in the Nexus or equivalent. Common arrangement is to have there one repo for external dependencies, one for internal snapshot builds and one for internal release builds (per project). We have defined maven central repository as well as the internal repositories in Maven configuration, storing the artifacts in the relevant internal repositories (external, internal-release or internal-snapshot) and picking them up from there, but having central repo as a backup for standard plugins.
  • Repository references (definitions, urls) are either in Maven settings file or then in the pom.xml. Individual developer should not need to do anything, he/she just uses these files. pom.xml would be in the SCM, settings file could be there or not.
  • Maven uses also local cache when it downloads the files, so they are downloaded only once per version/machine, which should keep the NW overhead tolerable. Intranet repo is there also partly to reduce external network overhead.
  • Maven release plugin is often used to handle internal-snapshot and internal-release repository updates
  • Each developer has a local repository cache in his machine. This is a standard Maven feature. Eclipse can refer to these same files.
  • Code can be compiled with the help of eclipse-maven plugin (of which M2E is the most common), using Maven on the command line or then using Maven to generate regular Eclipse project files and then normally with Eclipse. We use command line and M2E+Eclipse both for this.
  • SCM would be for source code, repositories for binaries (including .jars)
问题回答

You configure all dependencies in the pom.xml for each project. Maven then downloads all needed jars from your enterprise repository. You don t need your SCM project any more and i would remove it. I don t think there is much network overhead, because Maven only downloads the jars the first time they are needed. After that, they are in the local repository (which every developer has on his machine), and only updates will be downloaded after the first time.

如果你使用M2Eclipse,那么标准Eclipse汇编器将与Maven建筑商一起推广,以便你能够使用所有Eclipse汇编特征。





相关问题
In Eclipse, why doesn t "Show In" appear for non-Java files?

If I have a *java file open, I can right click on the source, scroll down to "Show In (Alt-Shift-W)", and select Navigator. If I have an *xml, *jsp, or pretty much anything besides a Java source ...

Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

Eclipse smart quotes - like in Textmate

Happy Friday — Does anyone know if eclipse has the notion of smart quotes like Textmate. The way it works is to select some words and quote them by simply hitting the " key? I m a newbie here so be ...

Indentation guide for the eclipse editor

Is there a setting or plugin for eclipse that can show indentation guides in the editor? Something like the Codekana plugin for visual studio (not so fancy is also OK). Important that it works with ...

Adding jar from Eclipse plugin runtime tab

I want to add .jar files for plugin from the Runtime tab of manifest file. When I use the Add... button, I can see only sub-directories of the plugin project. So if I want to add same .jar file to ...

How to copy multiple projects into single folder in eclipse

I have two projects, Project1 and Project2. Now i want to copy this projects into eclipse workspace but i want these projects to be in a single folder like below. Eclipse Workspace -> Project -> ...

Java: Finding out what is using all the memory

I have a java application that runs out of memory, but I have no idea which code is allocating the memory. Is there an application with which I can check this? I use Eclipse.

热门标签