Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable eclipse warning "Projects must be referenced by an EAR or a WAR to use classpath publish/export dependencies..."?

I have a library that is used in several different eclipse projects (that I keep in different workspaces), some of which are Java EE projects (i.e. dynamic Web projects) and some which are plain Java projects. It is therefore present in multiple workspaces (that reference a shared subversion repository to keep the copies in sync).

In order to get the library's dependencies exported correctly for the Web projects, I've added the jar files it references to the project's deployment assembly tab with a path of "../" (using the Java Build Path Entries option in the deployment assembly tab). This works wonderfully for the Web projects, but when I open the project in a workspace that doesn't have a Web project, I get the following warning:

Projects must be referenced by an EAR or a WAR to use classpath publish/export dependencies whose runtime path (../) maps into the parent component.

Is there a way of disabling this warning, as the publish/export dependencies are basically irrelevant when I'm working with a plain Java project anyway?

like image 975
Jules Avatar asked Aug 26 '12 06:08

Jules


1 Answers

I was able to eliminate that warning by following the instruction at https://www.eclipse.org/forums/index.php/t/172866/.

In the .classpath file, replace:

<attribute name="org.eclipse.jst.component.dependency" value="../"/>

with

<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
like image 153
jaco0646 Avatar answered Nov 12 '22 19:11

jaco0646