[jbosstools-issues] [JBoss JIRA] (JBIDE-18377) Automatically add the dependencies specified in jboss-deployment-structure.xml to build path

Rob Stryker (JIRA) issues at jboss.org
Wed Jun 10 12:08:04 EDT 2015


    [ https://issues.jboss.org/browse/JBIDE-18377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13076974#comment-13076974 ] 

Rob Stryker commented on JBIDE-18377:
-------------------------------------

I've made a new commit to master to fix the remaining issue, but you should still verify that it still works on the imported project.  To test it, you'll want to import the project and retarget it to a given wildfly server. If you expand the classpath elements in the project explorer view, you'll eventually see that there's two entries there that match the deployment-structure entries. If you remove the module tags from the xml file, you should see the classpath file update itself. 

Again, this won't work unless the jboss-deployment-structure.xml file is there when you start the workspace, which is unfortunate, but not a huge bug, since people generally only add a deployment-structure.xml file once for a project.   But it does affect people just trying to get up and running. 

> Automatically add the dependencies specified in jboss-deployment-structure.xml to build path
> --------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-18377
>                 URL: https://issues.jboss.org/browse/JBIDE-18377
>             Project: Tools (JBoss Tools)
>          Issue Type: Feature Request
>          Components: server
>            Reporter: Gary Hu
>            Assignee: Rob Stryker
>             Fix For: 4.3.0.Beta1
>
>         Attachments: project.zip
>
>
> I am deploying a dynamic web project to EAP 6 using JBDS 6+. My project's build path includes the JRE System Library, EAP 6 Runtime, and Web App Libraries (the WEB-INF/lib folder). I also have a jboss-deployment-structure.xml file that defines additional module dependencies such as the following:
> <jboss-deployment-structure> 
> <deployment> 
> <dependencies> 
> <module name="org.slf4j" /> 
> <module name="org.apache.log4j" /> 
> </dependencies> 
> </deployment> 
> </jboss-deployment-structure>
> The problem is, the slf4j and log4j modules are not included in the project's build path. While the server resolves them correctly at runtime because of the jboss-deployment-structure.xml file, Eclipse doesn't include them. So the following declaration in the Java code would result in a build error because org.apache.log4j cannot be resolved to a type:
> private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(Example.class);
> Please note that the project has configured correctly the JBoss Server Runtime which points to a valid JBoss directory, and the module dependencies are properly installed in the server.
> The dependencies specified in the jboss-deployment-structure.xml are some private modules installed at the server side but not included in the server runtime by default.
> So, is there a way to automatically add the jboss-deployment-structure module dependencies to the Eclipse build path? So far, I've been unable to find a way to do this.
> I have found a few workarounds, but none of them are ideal, and they seem to completely miss the point of module-based dependencies:
>    - Customize the Default Classpath Entries for the server runtime. This is not acceptable because it must be done in each developer's workspace – and possibly per project since projects may have different, conflicting dependencies.
>     - Add the libraries to WEB-INF/lib. This is not acceptable because it defeats the purpose of server modules.
>     - Add the libraries to a user library for the project. This could work, but it's very inconvenient, because each developer on the team would have to add the jars to the user libraries in their workspaces.
> Here can find the discussion of exact same issue https://developer.jboss.org/thread/203309?tstart=0



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)



More information about the jbosstools-issues mailing list