8

I'm trying to create an executable jar from IntelliJ.

First I got the Java Security Exception and I changed sqljdbc4-4.0 to unsigned. First problem solved.

Then I got Manifest not found. Added META-INF dir to output. Second problem solved.

Next I got the BeanCreationException (unsolved):

Caused by: org.springframework.beans.factory.BeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath.

In IntelliJ it is working.

I think the resources are not in the output. (application.properties, ...)

IntelliJ Config

In which way do I add the resources or where are they stored in the jar.

I'm using gradle and on the spring boot homepage are only instructions for maven.

Derek Mahar
  • 27,608
  • 43
  • 124
  • 174
rala
  • 895
  • 2
  • 18
  • 43

2 Answers2

10

You should use spring-boot-maven-plugin or spring-boot-gradle-plugin, depending on your preferred build system.

EDIT:

Just run ./gradlew build

I suggest to dive into this getting started guide. It clarifies a lot of stuff for beginners.

luboskrnac
  • 23,973
  • 10
  • 81
  • 92
  • 1
    I've gradle. In Spring boot docu I only found maven and I haven't used this build mode before. Can you please be more in detail? – rala Nov 08 '15 at 10:54
4

A typical Spring boot project is a Maven project or a Gradle-Project (I only know how to do it with Maven, for Gradle see [luboskrnacs answer][1]). So you just need to run the maven targetpackageand pick the jar form the (created)target` folder

use a shell, go to the project root directory (where the pom.xml file is) and type

mvn clean package
cd target

the there is the xxx.jar file.

Ralph
  • 118,862
  • 56
  • 287
  • 383