Search code examples
javamavenjarspring-tool-suite

How to make STS or Maven stop generating JAR in project directory?


I have this code in pom.xml regarding <build></build>

<build>
    <finalName>Fleaty</finalName>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

Every time I go Run As -> Spring Boot application, I get some jar file in project directory. How to not make STS or Maven generate jar file?

I cannot gitignore it.enter image description here


Solution

  • Your launch config has probably the option checked to generate a temporary JAR to avoid classpath length issues - in the launch config on the Classpath tab.

    Depending on the number of JAR files on your classpath, the command to launch your app might get very very long and might cause trouble with some limitations on Windows for the length of the command line (that is being executed to run your app). To workaround this limitation, the IDE generates a temporary JAR and runs the app from there. But you can disable that in the launch config.