maven-resources-plugin

Error loading property file Maven

淺唱寂寞╮ 提交于 2020-01-23 02:34:30
问题 i get this error from eclipse marker , when i try to load a filter file from pom.xml. it display the message below. Error loading property file 'src/main/filters/filter.properties' (org.apache.maven.plugins:maven-resources-plugin:2.6:resources:default-resources:process-resources) pom.xml: <execution> <id>default-resources</id> <phase>process-resources</phase> <goals> <goal>resources</goal> </goals> <configuration> <resources> <resource> <directory>src/main/resources</directory> <filtering

Maven plugin output to recourse file using filtering

雨燕双飞 提交于 2020-01-06 07:24:10
问题 I have resource file containing: ${project.version} ${dependency.tree} Is it possible to replace (filtering) ${dependency.tree} property with mvn dependency:tree -Dincludes=com.foo.bar command output ? 回答1: No easy way out here, but I think it's possible. I'd do it this way: Bind dependency plugin goal tree execution to generate-resources phase and configure it to output everything to some file ( outputFile option, see here). Use gmaven plugin to load this file into a dependency.tree property

How to use maven-resource-plugin to overwrite files

大城市里の小女人 提交于 2019-12-24 23:53:32
问题 I am trying to overwrite one of the files in my project at build time using maven-resource-plugin. I am having multiple profiles in my pom.xml and want to overwrite files base upon the profiles. My project structure src/main/java -- entity SomeClass.java src/main/resources --common-aws SomeClass.java --common-onprem SomeClass.java So the SomeClass.java inside entity folder has to be replaced by either of the file from common-aws folder or common-onprem folder based on the pom.xml profiles. I

maven resources plugin flat copy of resources

心不动则不痛 提交于 2019-12-24 05:41:30
问题 Given a folder 'database' containing JAR-connectors for different RDBMS. Each JAR is located in its own folder: +---database +---db2 +---db2.jar +---derby +---derby.jar +---h2 +---h2.jar +---mysql +---mysql.jar I need all of those JAR-files to be copied into WEB-INF\lib. Here's my pom.xml: <build> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <webResources> <resource> <directory>../target/$

Howto copy README.md into src/main/resources?

房东的猫 提交于 2019-12-24 04:26:10
问题 I want to show README.md file like help page in my web application. In order not to create duplicate, I need to copy by mvn from project path into resources. How can I do so? Any idea? I have tried: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.3</version> <configuration> <!-- this is important --> <overwrite>true</overwrite> <!-- target --> <outputDirectory>${basedir}/target/classes</outputDirectory> <resources> <resource> <!-

Strange NullPointerException in maven-resources-plugin

岁酱吖の 提交于 2019-12-22 08:49:58
问题 About twice a day we get a NullPointerException in our build: [06:44:23]: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project spring-lib: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed. NullPointerException -> [Help 1] [06:44:23]: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5

Maven build is not filtering properties in Intellij

旧街凉风 提交于 2019-12-21 12:16:05
问题 I am having an issue where when I run by Maven build from Intellij 15.0.2 the Maven Resources Plugin is not filtering my properties into my files. It does work when I run mvn compile from the Windows command line. My plugin config is: <properties> <prop1>aaa</prop1> <prop2>bbb</prop2> </properties> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.7</version> <configuration> <resources> <resource> <directory>src/main/resources<

Maven : add external resources

 ̄綄美尐妖づ 提交于 2019-12-18 11:13:13
问题 I am building an executable jar file with maven, meaning that you run it with "java -jar file.jar". I want to rely on user defined properties (just a file containing keys/values), during developpement phase I was putting my "user.properties" file in maven /src/main/resources/ folder. My property file is loaded with: final Properties p = new Properties(); final InputStream resource = IOParametres.class.getResourceAsStream("/user.properties"); p.load(resource); Now, I want to keep that file

How do I filter test resources in maven?

落爺英雄遲暮 提交于 2019-12-17 23:10:01
问题 I have the following pom.xml . When I run mvn clean resources:testResources , my test resources aren't being filtered (replacing placeholders in resources before they are put, in their modified form, into the output folder). Why? <?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<

Could not transfer artifact from/to central because of InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

只谈情不闲聊 提交于 2019-12-12 14:10:31
问题 When I try to install the pom.xml of maven project, I get the following error. Please help. Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project pm: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Could not transfer artifact classworlds:classworlds:jar:1.1 from/to