0

So, I tried making another project depending on my base project, it worked and now for some reason my base project won't build correctly.

Whenever I build my maven project, no jar is outputted anywhere. I checked my build path, and the target folder.

My pom.xml:

<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>...</groupId>
    <artifactId>...</artifactId>
    <version>1.1</version>

    <repositories>
        ...
    </repositories>

    <dependencies>
        ...
    </dependencies>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <resources>
            <resource>
                <directory>${basedir}</directory>
                <includes>
                    ...
                </includes>
                <excludes>
                    <exclude>target/</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <outputDirectory>...</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Now, with my original builds they still had the target folder for some reason, but now nothing is built at all.

11
  • Did adding <packaging>jar</packaging> in your pom help?
    – bhusak
    Oct 4, 2019 at 0:27
  • Whenever I build my maven project How exactly did you do this? Oct 4, 2019 at 0:34
  • What's your Maven goal setting?
    – LHCHIN
    Oct 4, 2019 at 0:49
  • @chrylis I build it through Intellij, should of specified but too late so whatever.
    – Big_Bad_E
    Oct 4, 2019 at 0:52
  • 3
    The first thing is to follow convention over configuration so remove resources configuration and the configuration for maven-jar-plugin cause it's already bound to the life cycle and just try a plain mvn clean package on command line and see if there is no error/warning etc. afterwards take a look into target folder...Why have you added repositories in your pom file? Are within a company ?
    – khmarbaise
    Oct 4, 2019 at 6:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.