Eclipse Multi-Project Collaborative management practice

Source: Internet
Author: User

Each project from the start of coding to delivery will produce some common classes, packages, and configuration files, and strengthen the management of these common files can make the team in the future work more efficient. For example, the JSON format conversion tool class, the WebService project may also use the common entity class. In general, we have these classes in each project to hold a copy, but in some cases, these things are not stable, frequent changes may result in multiple functions held between the class is not uniform, improve can not be quickly spread, such as the shortcomings.

A good development habit is to extract the unified functionality of the class and package files, here with the above mentioned JSON format conversion tool class and entity classes shared among multiple projects as an example to make a simple elaboration.

First, create a new working set to hold all project files related to the current project.

There will be at least one master project for each project, and the main project may invoke the services provided by other projects, as is the case with the WebService client service side, and there may be situations where the main project calls the classes in the subproject directly, So how does this happen in eclipse?

Let's take a look at how Web engineering is set up.



Open the properties settings for the main project, add the deployment items in Deployment assembly, add the dependent sub-projects as deployment items, so that when Eclipse is building the project, it will automatically package the subproject as a jar file and add it to the Lib directory. And the source files of the two projects are interrelated in eclipse.

What if the main project is not a Web project?

or by adding a subproject to the projects entry in the Java Build path in the properties setting of the main project.

With the simple setup above, the sub-project can be modified only once, and other projects that depend on the project can react quickly, as Java advocates,Writeonce,run anyway!

Note: The above settings may differ in MyEclipse

Not only limited to the dependencies between Java Engineering, in the Web project often there are some common JS files, when the modification of these files, will be modified to apply to other projects may require a lot of copy and paste, there is no technical content. Careful friends can find that in the Web project deployment assembly settings, can only add Java engineering to the deployment path, JavaScript engineering is not. We know that the plugin mechanism of eclipse is very strong and extensibility is very good, install the Jbosstools plugin can solve this problem.


For example, you can find a fileset option, where the JavaScript project can be introduced into the Web project deployment path with a simple setup, and, of course, which path can be deployed entirely by itself.

Genese

Date of Completion: 2014/5/15

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.