| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE html |
| PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html lang="en-us" xml:lang="en-us"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| <!-- /******************************************************************************* |
| * Copyright (c) 2000, 2005 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ --> |
| <link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" /> |
| |
| <title>Correcting cyclical dependencies after an EAR is imported</title> |
| </head> |
| <body id="tjcircleb"><a name="tjcircleb"><!-- --></a> |
| <h1 class="topictitle1">Correcting cyclical dependencies after an EAR is imported</h1> |
| <div><p>You can resolve cyclical dependencies after an EAR is imported.</p> |
| <div class="section">A cyclical dependency between two or more modules in an enterprise |
| application most commonly occurs when projects are imported from outside the |
| workbench. When a cycle exists between two or more modules in an enterprise |
| application, the Java™ builder cannot accurately compute the build order |
| of the projects. Full builds fail under these conditions, or require several |
| invocations.<p>Therefore, the best practice is to organize your projects or |
| modules into components. This allows your module dependencies to function |
| as a tree instead of a cycle diagram. This practice has the added benefit |
| of producing a better factored and layered application.</p> |
| </div> |
| <ol><li><span>Identify all the classes within the JAR files that have cyclical |
| dependencies, then move those classes into a common Java project |
| or JAR file.</span></li> |
| <li><span>Use the enterprise application editor to map utility JAR files |
| to the common projects.</span></li> |
| <li><span>Use the JAR dependency editor or properties page, for each module |
| of the JAR in the application, to set dependencies only to the JAR files that |
| are truly required.</span></li> |
| </ol> |
| </div> |
| <div> |
| <div class="familylinks"> |
| <div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/ph-importexport.html" title="These topics cover how to import files and projects into the workbench and export files and projects to disk.">Importing and exporting projects and files</a></div> |
| </div> |
| <div class="relconcepts"><strong>Related concepts</strong><br /> |
| <div><a href="../topics/cjcircle.html">Cyclical dependencies between J2EE modules</a></div> |
| </div> |
| <div class="reltasks"><strong>Related tasks</strong><br /> |
| <div><a href="../topics/tjimpear.html" title="Enterprise application projects are deployed into EAR files. You can import an enterprise application project by importing it from a deployed EAR file.">Importing an enterprise application EAR file</a></div> |
| </div> |
| </div></body> |
| </html> |