[HELP] Maven does not create .jar File

Discussion in 'Programming' started by ColdDev, May 27, 2016.

  1. Hey guys,

    i have a big problem. I want to create a bungeecord plugin with maven and a created in IntelliJ IDEA a maven project and a module called "bungeesystem". http://prntscr.com/b8zvwm

    Now i want to build the jar and no file is creating and i don't know why

    Code (Text):
    <?xml version="1.0" encoding="UTF-8"?>
    <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/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <parent>
            <artifactId>bukkitfaqserver</artifactId>
            <groupId>me.colddev.server</groupId>
            <version>1.0-SNAPSHOT</version>
        </parent>
        <modelVersion>4.0.0</modelVersion>
        <packaging>pom</packaging>

        <groupId>me.colddev.server</groupId>
        <artifactId>bungeesystem</artifactId>
        <version>1.1</version>

        <repositories>
            <repository>
                <id>bungeecord-repo</id>
                <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            </repository>
        </repositories>

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
            </plugins>
        </build>

        <dependencies>
            <dependency>
                <groupId>net.md-5</groupId>
                <artifactId>bungeecord-api</artifactId>
                <version>1.9-SNAPSHOT</version>
                <type>jar</type>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>net.md-5</groupId>
                <artifactId>bungeecord-api</artifactId>
                <version>1.9-SNAPSHOT</version>
                <type>javadoc</type>
                <scope>provided</scope>
            </dependency>
        </dependencies>


    </project>

    best regards
    ColdDev
     
  2. Post the maven build log
     
  3. Code (Text):
    "C:\Program Files\Java\jdk1.8.0_73\bin\java" "-Dmaven.home=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1.2\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1.2\plugins\maven\lib\maven3\bin\m2.conf" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.1.2 clean install
    [INFO] Scanning for projects...
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building bungeesystem 1.1
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ bungeesystem ---
    [INFO]
    [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ bungeesystem ---
    [INFO] Installing C:\Dev\BukkitFAQ\bungeesystem\pom.xml to C:\Users\mhopp\.m2\repository\me\colddev\server\bungeesystem\1.1\bungeesystem-1.1.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.757s
    [INFO] Finished at: Fri May 27 12:36:21 CEST 2016
    [INFO] Final Memory: 5M/109M
    [INFO] ------------------------------------------------------------------------

    Process finished with exit code 0
     
  4. Personally not a Maven expert but being using it for quite a while now, try changing your <build> section to the below (from my plugins)

    Code (Text):
    <build>
            <defaultGoal>clean package install</defaultGoal>
            <finalName>PluginName-${project.version}</finalName>
            <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>true</filtering>
                </resource>
            </resources>

            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.0</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
            </plugins>

        </build>
     
  5. You haven't added it as a module to your core project.
    <modules>
    <module>module-name</module>
    </modules>
     
  6. It don't work to.
    Code (Text):
    "C:\Program Files\Java\jdk1.8.0_73\bin\java" "-Dmaven.home=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1.2\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1.2\plugins\maven\lib\maven3\bin\m2.conf" -Didea.launcher.port=7535 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.1.2 clean install
    [INFO] Scanning for projects...
    [INFO]                                                                        
    [INFO] ------------------------------------------------------------------------
    [INFO] Building bungeesystem 1.1
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ bungeesystem ---
    [INFO]
    [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ bungeesystem ---
    [INFO] Installing C:\Dev\BukkitFAQ\bungeesystem\pom.xml to C:\Users\mhopp\.m2\repository\me\colddev\server\bungeesystem\1.1\bungeesystem-1.1.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.795s
    [INFO] Finished at: Fri May 27 13:09:53 CEST 2016
    [INFO] Final Memory: 6M/77M
    [INFO] ------------------------------------------------------------------------

    Process finished with exit code 0
     

    I added the module in my core project, but maven builds only the module
     
  7. Could you put all poms on hastebin please? And show us your project structure