Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to hide Maven 2 "target/" folder in Eclipse 3?

People also ask

How do I ignore target folder in Eclipse?

Mark the "target" folders as "derived" resource from the properties screen of those folders (this option is next to read only and archive property). In the quick search ( Ctrl + Shift + R ) screen press the arrow in the top right corner and untick "Show derived resources".

Can we delete target folder in Maven?

To delete the target directory, run mvn clean on your project directly from the command line. That will delete the target directory as expected. In contrast, running Run As > Maven clean from Eclipse for some reason leaves the target directory and subdirectories classes and test-classes.

What is the target folder in Eclipse?

The target folder is the maven default output folder. When a project is build or packaged, all the content of the sources, resources and web files will be put inside of it, it will be used for construct the artifacts and for run tests. You can delete all the target folder content with mvn clean command.

Where is Maven target folder?

The maven targets are located in your project config/ folder.


Right click on the folder you want to ignore, open the "Properties" dialog, chose the "Resource" tab and check the box that says "Derived"


Reconfigure "clean" in Maven not to delete target directory:

<plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <configuration>
        <excludeDefaultDirectories>true</excludeDefaultDirectories>
        <filesets>
            <!-- delete directories that will be generated when you 
                 start the develpment server/client in eclipse  
            -->
            <fileset>
                <directory>target</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </fileset>
        </filesets>
    </configuration>
</plugin>

(found at: http://maven.40175.n5.nabble.com/how-to-NOT-delete-target-dir-td3389739.html#a3413930)


Solution for Indigo [SR2]

Project Explorer > Customize View > Filters > [*] Maven Build Folder


I have been so pissed by this problem that I wrote a plugin to solve it. You get get the source and jar from:

https://github.com/YA2O/Eclipse_Plugin_Target_Derivator