无限Maven'目标/班级'文件夹

时间:2015-01-19 17:11:55

标签: java eclipse maven directory

我正在使用Eclipse(Kepler)和Eclipse的m2e Maven插件。 我有一个Maven项目,但是当我在Eclipse中导出jar时(如右键单击项目,导出,jar等),它会创建一个奇怪的无限或几乎无限的文件夹循环。

这是该项目的Eclipse文件夹(它没有任何问题): PIC 1 (图片链接位于页面末尾,无法上传图片)

现在,当我进入目标文件夹时,它仍然很好: PIC 2

一切都很好,你可以看到。

但是,当我导航到classes文件夹时,还有另一个'target'文件夹,其中包含另一个文件夹'classes',其中包含'target',依此类推......

当您从最后一张图片进入classes文件夹时,这是视图。 PIC 3

正如你所看到的,它一直在继续。它是可移动的,但我使用了'robocopy'和cmdprompt。它继续回去。 PIC 4

图片: http://pastebin.com/p1QiAVnE

如何阻止Eclipse执行此操作?

编辑:我当然应该分享我的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>

2 个答案:

答案 0 :(得分:1)

我有同样的问题,无限的类/目标/类/目标目录。我不得不使用一个名为Long Path Eraser的免费程序来删除这些目录。

我会告诉你是什么解决了我的问题,我改变了这个:

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

对此:

 <include>filename.yml</include>

而不是让maven搜索文件。幸运的是我只有一个文件,所以这对我来说是一个有效的解决方案。如果您将其更改为“directory / *。yml”而不是通配符目录,则可能会有所帮助。

答案 1 :(得分:0)

这里可能有问题,但希望只是钻进JAR导出对话框以扩展项目并取消选择目标文件夹。似乎对话框可能会更清楚它将包含在jar文件中的内容,但相反它(至少在我的情况下)折叠项目,因此隐藏了将包含在jar中的细节。看看您是否可以找到此处显示的复选框,并在未选中该框的情况下再次导出。祝你好运!

Eclipse's jar export dialog  box