Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA not copying resources on build

My build output is out/production/classes. Java files get compiled into classes just fine and get put on out/production/classes/[packageName], but resources aren't copied. As far as I know they should go directly inside the out/production/classes directory.

Resources aren't copied

If relevant, I'm using Java 11, Spring Boot and Gradle. This is my build.gradle

plugins {
    id 'org.springframework.boot' version '2.1.3.RELEASE'
    id 'java'
}

apply plugin: 'io.spring.dependency-management'

group = 'net.impfox'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    // hidden
}

And my Compiler settings:

Compiler settings

What could be the cause for my resources not being copied to the output directory and how can I fix this?

like image 650
Impulse The Fox Avatar asked Apr 16 '19 21:04

Impulse The Fox


Video Answer


1 Answers

If someone is having this issue in Maven. I fixed it by changing the

<packaging>pom</packaging>

to

<packaging>jar</packaging>

In pom.xml

I copied a pom.xml in a maven moduler project (in main pom.xml it uses pom as packaging). Guess I learned my lesson.

like image 73
Thamidu de Harshitha Avatar answered Oct 10 '22 19:10

Thamidu de Harshitha