The best solution is to avoid snapshots altogether. They are fine for
dependencies among different modules of the same project, but cause
problems when used for inter-project dependencies. When using snapshots
you never really know what build includes what exact dependencies
versions, so you can't reliably tell if certain change was tested or
not, for example. Another problem is that you have to modify your
pom.xml during or right before the release, which is the worst possible
time to do that. If you really have to develop several projects in lock-
step, then they probably is one project and should be merged together.

If you absolutely must use snapshots, then you have couple of options.
Either import all involved projects in m2e workspace, in which case m2e
will use workspace sources and compiled classes. Or remove snapshots
from local repository and force dependency resolution of workspace
projects, in which case m2e will resolve artifacts and their
corresponding sources at about the same time.

--
Regards,
Igor
 
 
On Sun, Jul 12, 2015, at 08:57 AM, Dagan Sandler wrote:
> Thanks for the quick reply.
>  
> Do you know what's the quickest/easiest workaround to fix this when 
> encountered? Is there any action in eclipse alone that will trigger an update 
> to the sources?
> Where does this problem stem from anyway? Is it an eclipse cache of some sort?
>  
>  
>  
> On Sun, Jul 12, 2015 at 3:33 PM, Igor Fedorenko <[email protected]> wrote:
>> __
>> This is a known problem. You've found the right bugzilla. I am not aware of 
>> any plans to fix this.
>>  
>> --
>> Regards,
>> Igor
>>  
>>  
>> On Sun, Jul 12, 2015, at 07:45 AM, Dagan Sandler wrote:
>>> Hi,
>>>  
>>> I just came across a bug where after deploying a snapshot version, the jar 
>>> itself is getting updated but the sources do not (at least not in eclipse).
>>>  
>>> This sounds a lot like this bug:
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=367758
>>> which didn't seem to get any attention at the time, so maybe it's related.
>>>  
>>> Here's a more elaborate description of my setup and steps I took while 
>>> exploring the issue:
>>>  
>>> 1. On machine A - deploy Project1 0.0.1-SNAPSHOT (to nexus)
>>> 2. On machine B - use Project1 0.0.1-SNAPSHOT as dependency in some 
>>> project, view sources, everything seems fine
>>> 3. On machine A - update some class in Project1, redeploy 0.0.1-SNAPSHOT 
>>> (to nexus)
>>> 4. Use Project1 as dependency on new machine C - everything looks normal, 
>>> sources up to date - so no issue with deployment or nexus.
>>> 5. On machine B - perform Maven Update with Force update of snapshots. Look 
>>> at resolved dependencies - notice correct timestamp for snapshot. Open 
>>> sources of updated class - still showing old sources.
>>> 6. Look in local maven repository on machine B - correct sources jar seems 
>>> to be present, but eclipse still shows old sources.
>>>  
>>> Tried cleaning, performing maven update with force update, nothing.
>>> Right clicking on the project/dependency and choosing Maven->Download 
>>> Sources had no effect.
>>> Eventually I manually deleted the dependency from local repository, forcing 
>>> maven to re-download artifacts, and sources were also updated this way.
>>>  
>>> Using Eclipse Luna, release version of m2e (I can look up the exact version 
>>> if necessary, just don't have access to said machine at the moment)
>>>  
>>> Is this a known issue? Am I doing something wrong?
>>> _________________________________________________
>>> m2e-users mailing list
>>> [email protected]
>>> To change your delivery options, retrieve your password, or unsubscribe 
>>> from this list, visit
>>> https://dev.eclipse.org/mailman/listinfo/m2e-users
>>  
>>  
>> _______________________________________________
>> 
m2e-users mailing list
>> [email protected]
>> 
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
>> https://dev.eclipse.org/mailman/listinfo/m2e-users
> _________________________________________________
> m2e-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/m2e-users
 
_______________________________________________
m2e-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users

Reply via email to