[jbosstools-issues] [JBoss JIRA] (JBIDE-14003) Automatically discover library sources for non-maven projects

Snjezana Peco (JIRA) jira-events at lists.jboss.org
Mon Apr 15 16:25:54 EDT 2013


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

Snjezana Peco commented on JBIDE-14003:
---------------------------------------

{quote}
Snjezana Peco your video assumes users across all teams have the source lookup plugin installed and enabled. Something that I do not think we should assume. At least not with the current implementation.
{quote}

{quote}
automatically fixing invalid/missing sources as shown in http://screencast.com/t/iGFBsQYBOhtG is very nice, but you still could do the exact same thing using %M2_REPO%.

Again, another user not having the JBoss Source feature installed could still benefit from the M2_REPO variable either by having m2e installed already or by creating that variable manually.
{quote}

I have tried, but haven't succeeded to do it. There are the following issues:

- a classpath variable can't be used either for a classpath entry of the "lib" type or for an entry of the "con" type
what means the M2_REPO variable can't be used for a library entry in the test13848 project. The following entry isn't valid:
{code}
<classpathentry kind="lib" path="lib/commons-lang-2.6.jar" sourcepath="${M2_REPO}/commons-lang/commons-lang/2.6/commons-lang-2.6-sources.jar"/>
{code}
and there is no way to add a classpath variable to such entries.
A classpath variable can be used only in the entries of the "var" type, but they are rarely used.
M2e doesn't use M2_REPO because it can't be used for the Maven Container.
- users that don't have the Source Lookup plugin would have to download source jars

{quote}
How is this actually wired in - which files will be edited ? just .classpath ?
{quote}

We don't edit a file directly. In the screencast, attaching a source updates .classpath, but that is not always the case. The WTP, m2e containers have a separate file to save data about source/javadoc attachments. Those files aren't placed within a project, but in the workspace's .metadata/.plugins.

{quote}
Any preferences we need to overwrite (like for launch configs we are listening for specific launch config types and "forces" us in place - is there something similar here?).
{quote}

This feature uses only the "Automatically configure the Java Source Attachment" preference that enables/disables a source attachment.

{quote}
How do you guarantee the m2e source lookup mechanism takes precedence for maven-enabled projects?
{quote}

We can't guarantee that because Eclipse decides in what ordering editor actions should be executed. But it doesn't matter because each of those actions will add a source jar correctly. 

                
> Automatically discover library sources for non-maven projects
> -------------------------------------------------------------
>
>                 Key: JBIDE-14003
>                 URL: https://issues.jboss.org/browse/JBIDE-14003
>             Project: Tools (JBoss Tools)
>          Issue Type: Sub-task
>          Components: maven
>    Affects Versions: 4.1.0.Alpha1
>            Reporter: Fred Bricon
>            Assignee: Snjezana Peco
>             Fix For: 4.1.0.Beta1
>
>         Attachments: test13848a.zip
>
>
> As a follow up of JBIDE-13848, enable automatic discovery of library sources for non-maven projects.
> * This feature should be turned on/off in the preferences
> * If the source file referenced in .classpath doesn't exist, it should attempt to discover a new, valid one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list