Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336411 - Automatically mark target folder as Derived
Summary: Automatically mark target folder as Derived
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Matthew Piggott CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-05 00:39 EST by Igor Fedorenko CLA
Modified: 2021-04-19 13:27 EDT (History)
10 users (show)

See Also:


Attachments
Mark output folder as derived in configuration (2.36 KB, patch)
2011-04-20 14:46 EDT, Matthew Piggott CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Fedorenko CLA 2011-02-05 00:39:27 EST
Clone from https://issues.sonatype.org/browse/MNGECLIPSE-2637

I think it would be very useful if m2eclipse could automatically mark the target folder as "Derived" once activated for a project (i.e. after selecting Maven > Enable Dependency Management).

I find myself having to do this manually very often as I am often adding new projects to my workspace after checking out from source control and enabling m2eclipse on them.

Without the target folder being marked as derived, the folder's contents are automatically picked up by Eclipse's search feature, listed in resources view (i.e. ctrl + shift + R), the SCM plugin tries to automatically mark the files as 'add' to source control, etc.
Comment 1 Michael Osipov CLA 2011-04-07 06:43:05 EDT
I was looking for a soluction for this PITA issue. I derived flag should be set when I perform "update proj config" too. I'd even bump priority.
Comment 2 Jeff Jensen CLA 2011-04-07 10:50:06 EDT
Yes, it is a royal PITA.

I solved it by using the Frills plugin with Helios:
http://eclipsefrills.sourceforge.net/

It adds a "Frills" menu with a "Mark Derived" option.
Comment 3 Igor Fedorenko CLA 2011-04-07 11:12:44 EDT
we accept good patches  ;-)
Comment 4 Michael Osipov CLA 2011-04-12 08:19:17 EDT
(In reply to comment #2)
> Yes, it is a royal PITA.
> 
> I solved it by using the Frills plugin with Helios:
> http://eclipsefrills.sourceforge.net/
> 
> It adds a "Frills" menu with a "Mark Derived" option.

Works as long as the folder is not deleted. If deleted my clean, you have to reset the flag again. Well, way better than doing thing manually.
Comment 5 Matthew Piggott CLA 2011-04-20 14:46:54 EDT
Created attachment 193736 [details]
Mark output folder as derived in configuration

Here's a potential patch for this, does it look correct Igor?
Comment 6 Matthew Piggott CLA 2011-04-20 17:41:40 EDT
http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=6bac8880fd4f0dfb83de5f641929d9ff7f918665

The patch I've committed will mark the build directory as derived during project configuration.  As mentioned if the folder is deleted it is marking is gone.

Interestingly on 3.7 SDK it appears the properties page has an option to mark a folder as derived.
Comment 7 Neale Upstone CLA 2011-08-04 12:57:10 EDT
I wouldn't consider this as resolved, given that a clean will revert the benefit, and cleans happen all the time.

Can this behaviour also be hooked in at the clean part of the lifecyle?
Comment 8 Matthew Piggott CLA 2011-08-04 13:16:43 EDT
I've double checked, if you use Project > Clean the folder is still marked as derived.
Comment 9 Neale Upstone CLA 2011-08-04 15:01:44 EDT
Many thanks.  Sorry not to have been able to discover that myself from experience, but waiting on AJDT configuration support before moving to 1.0.

This is yet another a great papercut to have nailed.  Thanks to all for the work that's gone into a bit improvement to Eclipse.
Comment 10 Jimi CLA 2011-09-13 08:18:50 EDT
(In reply to comment #8)
> I've double checked, if you use Project > Clean the folder is still marked as
> derived.

Is it possible to make this fix also handle Clean from outside eclipse? I frequently use maven in the command line to build the project ("mvn clean install"), but I still want the target-folders to remain derived.
Comment 11 Michael Osipov CLA 2011-09-13 08:47:02 EDT
(In reply to comment #10)
> (In reply to comment #8)
> > I've double checked, if you use Project > Clean the folder is still marked as
> > derived.
> 
> Is it possible to make this fix also handle Clean from outside eclipse? I
> frequently use maven in the command line to build the project ("mvn clean
> install"), but I still want the target-folders to remain derived.

I absolutely agree, this one is really annoying.
Comment 12 Igor Fedorenko CLA 2011-09-13 09:01:13 EDT
We welcome quality patches (though a separate bugreport is probably good idea in this case)
Comment 13 Srgjan Srepfler CLA 2012-05-02 07:24:27 EDT
Hi, while this does work for an imported project, if a pom project exists with the children projects, the children targets are still present and not marked as derived. On the other hand, the "Hide folders of physically nested modules" might make this case obsolete.
Comment 14 Petr Bodnar CLA 2012-10-24 09:34:57 EDT
(In reply to comment #10)
> (In reply to comment #8)
> > I've double checked, if you use Project > Clean the folder is still marked as
> > derived.
> 
> Is it possible to make this fix also handle Clean from outside eclipse? I
> frequently use maven in the command line to build the project ("mvn clean
> install"), but I still want the target-folders to remain derived.

What about this plug-in: http://sourceforge.net/projects/etinyplugins/files/KeepTargetDerivedPlugin/ ?
Comment 15 Denis Franco de Oliveira CLA 2018-05-14 13:15:25 EDT
Confirmed bugs from comments #10 and #12 . I'm gonna open separate reports for each of them
Comment 16 Andreas Fischl CLA 2018-11-06 09:20:23 EST
This comment mentions AutoDeriv which is an alternative to KeepTargetDerivedPlugin found in the Eclipse Marketplace:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=150578#c39

There's also another possible workaround which doesn't require a plugin:

Choose "Properties" of your project(s) in the project explorer; in "Resource -> Resource Filters" click on "Add Filter..." and choose an "Exclude all" filter on the directories/files you don't want.
Comment 17 Denis Roy CLA 2021-04-19 13:27:03 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/