Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Infinite Maven 'target/classes' folders

I'm using Eclipse (Kepler) and the m2e Maven plugin for Eclipse. I have a Maven project, but when I export the jar in Eclipse (as in right click project, export, jar, etc..), it creates a weird infinite or nearly infinite folder loop.

This is the Eclipse folder for that project (there's nothing wrong with it): PIC 1 (Pics link is at the end of the page, could not upload pics)

Now, when I go inside the target folder it's still all good: PIC 2

All is well as you can see.

However, when I navigate into the classes folder there is another 'target' folder that has another folder 'classes', which has 'target', and so on..

This is the view when you go into the classes folder from the last picture. PIC 3

As you can see, it keeps on going. It's removable, but I used 'robocopy' with cmdprompt. It keeps on going back though. PIC 4

Pics: http://pastebin.com/p1QiAVnE

What can I do to stop Eclipse from doing this?

EDIT: I should of course share my pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Autorank</groupId>
<artifactId>Autorank</artifactId>
<version>3.4-Dev-${BUILD_NUMBER}</version>
<name>Autorank</name>
<description>Maven project for Bukkit plugin Autorank</description>
<url>http://dev.bukkit.org/server-mods/autorank/</url>
<build>

    <sourceDirectory>src</sourceDirectory>

    <resources>

        <resource>
            <filtering>true</filtering>
            <directory>${basedir}</directory>
            <includes>
                <include>**/*.yml</include>
            </includes>
        </resource>


    </resources>

    <plugins>

        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <excludes>
                    <exclude>${basedir}/Javadocs</exclude>
                    <exclude>${basedir}/lib</exclude>
                </excludes>
            </configuration>
        </plugin>

        <!-- Stop Maven from including the dependencies (.jars) in the artifact 
            (created by Jenkins) -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <excludes>
                    <exclude>*.jar</exclude>
                </excludes>
            </configuration>
        </plugin>

    </plugins>

</build>

<properties> <!-- Fix encoding warnings -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>

    <repository>
        <id>bukkit-repo</id>
        <url>http://repo.bukkit.org/content/groups/public/</url>
    </repository>

    <repository>
        <id>Plugin Metrics</id>
        <url>http://repo.mcstats.org/content/repositories/public/</url>
    </repository>

    <repository>
        <id>stats-repo</id>
        <url>http://centrility.nl:8081/nexus/content/repositories/releases/
        </url>
    </repository>

    <repository>
        <id>sk89q-repo</id>
        <url>http://maven.sk89q.com/artifactory/repo/</url>
    </repository>

    <repository>
        <id>Spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/</url>
    </repository>

    <repository>
        <id>staartvin-repo</id>
        <url>http://62.131.38.74:8081/artifactory/ext-release-local/</url>
    </repository>

</repositories>

<dependencies>

    <dependency>
        <groupId>net.ess</groupId>
        <artifactId>Essentials</artifactId>
        <version>2.13.1</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>EssentialsGroupManager</groupId>
        <artifactId>EssentialsGroupManager</artifactId>
        <version>2.1.11</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>com.massivecraft</groupId>
        <artifactId>Factions</artifactId>
        <version>2.7.5</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>com.massivecraft</groupId>
        <artifactId>MassiveCore</artifactId>
        <version>2.7.5</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>com.platymuus</groupId>
        <artifactId>bukkit-permissions</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>nl.lolmewn.stats</groupId>
        <artifactId>Stats</artifactId>
        <version>2.0.1</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>net.milkbowl.vault</groupId>
        <artifactId>Vault</artifactId>
        <version>1.5.0</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>com.sk89q</groupId>
        <artifactId>worldedit</artifactId>
        <version>6.0.0-SNAPSHOT</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>org.mcstats.bukkit</groupId>
        <artifactId>metrics</artifactId>
        <version>R7</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>com.sk89q</groupId>
        <artifactId>worldguard</artifactId>
        <version>6.0.0-beta-01</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>com.gmail.nossr50.mcMMO</groupId>
        <artifactId>mcMMO</artifactId>
        <version>1.5.02</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>RoyalCommands</groupId>
        <artifactId>RoyalCommands</artifactId>
        <version>4.0.0</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>OnTime</groupId>
        <artifactId>OnTime</artifactId>
        <version>3.13.4</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>UltimateCore</groupId>
        <artifactId>UltimateCore</artifactId>
        <version>1.1.8</version>
    </dependency>

    <dependency>
        <groupId>Statistics</groupId>
        <artifactId>Statistics</artifactId>
        <version>1.2.3</version>
    </dependency>

    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.8-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>org.bukkit</groupId>
        <artifactId>bukkit</artifactId>
        <version>1.7.9-R0.2</version>
        <scope>provided</scope>
    </dependency>

</dependencies>

like image 522
Staartvin Avatar asked Jan 19 '15 17:01

Staartvin


1 Answers

I had this same problem, infinite class/target/class/target directory. I had to use a freeware program called Long Path Eraser to delete those directories.

I will tell you what solved my problem, I changed this:

<include>**/*.yml</include>

To this:

 <include>filename.yml</include>

Instead of letting maven search for the files. Fortunately I only had one file so this was a valid solution for me. Perhaps it might help if you change yours to "directory/*.yml" instead of a wildcard directory.

like image 57
Supercreature Avatar answered Sep 23 '22 10:09

Supercreature