Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.9
-
Fix Version/s: None
-
Labels:None
-
Number of attachments :
Description
I have some projects that share some common Java files (in a ../common directory) and I need to access that directory as a source tree (I know that having multiple source directory is not the maven way of doing things, but sometimes that's a need).
So, one way to do this is creating a folder on the project as a link to an existing one in the filesystem (or to an Eclipse variable). If I do so on Eclipse, it generates an entry like the following in .project:
<linkedResources>
<link>
<name>folder_A</name>
<type>2</type>
<location>FOLDER_VARIABLE_NAME</location>
</link>
<link>
<name>file_B</name>
<type>1</type>
<location>/folder/location/on/filesystem</location>
</link>
</linkedResources>
So, I think it would be nice to have a property (similar to what we have on the natures element) to add such links. Something like this:
maven.eclipse.links=folderA, fileB
maven.eclipse.links.folderA.name=folder_A
maven.eclipse.links.folderA.type=2
maven.eclipse.links.folderA.location=FOLDER_VARIABLE_NAME
maven.eclipse.links.fileB.name=file_B
maven.eclipse.links.fileB.type=1
maven.eclipse.links.fileB.location=/folder/location/on/filesystem
Optional, we could eliminate the need for a type variable by using variable or path:
maven.eclipse.links.folderA.name=folder_A
maven.eclipse.links.folderA.variable=FOLDER_VARIABLE_NAME
maven.eclipse.links.fileB.name=file_B
maven.eclipse.links.fileB.path=/folder/location/on/filesystem
<j:if test="$
{context.getVariable('maven.eclipse.links') != null}">
<linkedResources>
<util:tokenize var="links" delim=",">
$
</util:tokenize>
<j:forEach var="link" items="$
" trim="true">
<link>
<j:set var="name" value="maven.eclipse.links.$
<j:set var="type" value="maven.eclipse.links.${link}
.type"/>
<j:set var="location" value="maven.eclipse.links.$
.location"/>
<name>$
</name>
<type>$
</type>
<location>$
</location>
</link>
</linkedResources>
</j:if>
– Felipe
I really don't think that this is a good idea to implement. You should really share the source as either a Maven artifact or make a Eclipse project out of the common source and link them in Eclipse (using Maven).
It just feels like too much of a hack.