Infinite Maven Target / Class Folders

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

This is the Eclipse folder for this project (there is nothing wrong with it): PIC 1 (link to Pics is at the end of the page, photos could not be loaded)

Now, when I go to the destination folder, it’s still good: PIC 2

All is well, as you can see.

However, when I navigate to the classes folder, there is another “target” folder with another “classes” folder that has “target”, etc.

This is a view when you go to the classes folder from the last image. Pic 3

As you can see, he continues to move. It is removable, but I used robocopy with cmdprompt. However, he keeps coming back. 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> 

+5
source share
2 answers

I had the same problem, an infinite class / target / class / target directory. I had to use the free Long Path Eraser program to delete these directories.

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

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

For this:

  <include>filename.yml</include> 

Instead of letting maven search for files. Fortunately, I only had one file, so for me this was the right solution. Perhaps this will help if you change your code to "directory / *. Yml" instead of a wildcard directory.

+1
source

This may not be the case here, but hopefully this is just a drilling issue in the JAR Export dialog box to expand your project and deselect the destination folder. It looks like the dialog box might be a little more obvious as to what it will include in the jar file, but instead it (at least in my case) destroys the project and thus hides the details of what will be included in the jar . See if you can check the box shown here and export again if this box is not checked. Good luck

Eclipse's jar export dialog box

0
source

Source: https://habr.com/ru/post/1211432/


All Articles