Maven: how to place resource file together with jar?

No plugin definitions needed, just edit the build resources: <build> <resources> <!– regular resource processsing for everything except logback.xml –> <resource> <directory>src/main/resources</directory> <excludes> <exclude>logback.xml</exclude> </excludes> </resource> <!– resource processsing with a different output directory for logback.xml –> <resource> <directory>src/main/resources</directory> <includes> <include>logback.xml</include> </includes> <!– relative to target/classes i.e. ${project.build.outputDirectory} –> <targetPath>..</targetPath> </resource> </resources> </build> Reference: process-resources … Read more

How do I filter test resources in maven?

The resources and resource elements are for the resources:resources goal. resources:testResources uses testResources and testResource elements. The correct pom.xml is: <?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/maven-v4_0_0.xsd”> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>foo</artifactId> <version>0.0.1</version> <packaging>jar</packaging> <name>foo</name> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> </dependencies> <build> <testResources> <testResource> <directory>src/test/resources</directory> <filtering>true</filtering> </testResource> </testResources> </build> </project>

Maven clean install: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources

It might be a new bug coming with some latest release of Spring-boot (and then : Spring). I had it. The workaround is to put in your pom.xml this corrected dependency : <!– Pour contourner un bug à la génération par Spring-boot 2.4.x : Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project application-etude: Input length … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)