maven-plugin

How to expand variable into nested directory in maven-archetype

随声附和 提交于 2019-12-19 09:46:55
问题 Suppose I have set groupId to com.example , and artifactId to fancy.project , and now I want to create a archetype, such that when created, expands into the following structure: |--src |--main |--com |--example |-fancy |-project |-App.java That is, I wonder how to expand a variable into a nested directory. I understand that the dual-underscore-wrapped variables will be substituted in file/directory names, but I can only get the following with __groupId__ . |--src |--main |--com.example |

Can't use custom ruleset in maven-pmd-plugin 5.0.2

删除回忆录丶 提交于 2019-12-19 07:48:19
问题 I want maven-pmd-plugin to include rulesets that I specify and exclude some rules (specifically, UselessParentheses) Just like described in documentation, I placed the following in pmd.xml that is parent for all modules: <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>3.0</version> <configuration> <rulesets> <ruleset>/home/ubuntu/ruleset.xml</ruleset> </rulesets> </configuration> </plugin> </plugins> </reporting>

Can't use custom ruleset in maven-pmd-plugin 5.0.2

[亡魂溺海] 提交于 2019-12-19 07:48:04
问题 I want maven-pmd-plugin to include rulesets that I specify and exclude some rules (specifically, UselessParentheses) Just like described in documentation, I placed the following in pmd.xml that is parent for all modules: <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>3.0</version> <configuration> <rulesets> <ruleset>/home/ubuntu/ruleset.xml</ruleset> </rulesets> </configuration> </plugin> </plugins> </reporting>

Import maven plugin configuration by composition rather than inheritance. Can it be done with build extensions?

微笑、不失礼 提交于 2019-12-18 14:51:20
问题 Import maven plugin configuration by composition rather than inheritance. Can it be done with build extensions? I have used maven for more than 3 years and there's one shortcoming that has always bugged me. It's time to find a solution for that already. The problem: I have a "daddy" maven module with 3 children: "boy", "girl", and "kid". Each of these children must have its own distinct set of plugin configurations for a default "clean install" build. I don't want to put that configuration on

Maven plugin can't load class

强颜欢笑 提交于 2019-12-18 12:28:16
问题 I'm trying to make a maven plugin that needs to use reflection. I want a project to run the plugin, and give it the full name of a class in the project, and the plugin will load it by reflection to get info from it. There's something strange with the classloader though, because it can't find the class when I use Class.forName("package.MyClass"); Looking here, I can't quite figure out if my plugin's classloader, when being run in a different project, has access to that project's classes. 回答1:

Maven: How to use jetty:run in a multi-module Maven project, without needing to install

僤鯓⒐⒋嵵緔 提交于 2019-12-18 11:19:30
问题 I'm new to Maven. I have a multi-module maven 2 project that has the following structure (somewhat simplified): Project (POM packaging) | +-- Module1 (JAR) | | | +-- src | | | +-- main | | | +-- java | +-- resources | +-- Module2 (JAR) | | | ... | +-- Web Module (WAR) | ... I've configured the Web Module to include the Maven Jetty plugin. This works great for building the production artifacts. For development, I discovered that I need to call mvn install on any module that I change, followed

Maven: Including a META-INF folder in the classes folder

巧了我就是萌 提交于 2019-12-18 10:13:48
问题 I have a very simple WAR project and I want to include a directory named META-INF at the top of the classes output folder where all the compiled Java classes are. I'm using Maven, but it seems that by default Maven won't include anything that is not a Java class. So it ignores my META-INF directory that is sitting at the top of the src directory. The META-INF directory contains a file named persistence.xml . Any quick pointers on how to instruct Maven to put this directory and file into the

Include xml files in maven project

对着背影说爱祢 提交于 2019-12-18 05:25:20
问题 I have a maven pom file to build from a structure like: package1 --1.java --2.java --packageMetaInfo.xml package2 --21.java --22.java --packageMetaInfo.xml When I do a maven compile, the xml files don't come in the target. maven-compiler-plugin 3.5.1 - Unless I exclude the xmls through <exclusions> , I get an error that "Fatal error compiling: All compilation units must be of SOURCE kind ->" maven-compiler-plugin 2.0.1 - compiles but skips the xmls Is there a way I can have the xmls included

Could not calculate build plan :artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 is not available in the local repository

谁说我不能喝 提交于 2019-12-18 04:47:09
问题 I have a spring maven 2 project. I built it in terminal and everything is ok, I got build success, but when trying to import it to eclipse I got this error: Could not calculate build plan: The repository system is offline but the artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 is not available in the local repository. although I am getting build success in terminal and projects run fine. I made maven offline in eclipse, and disabled download index on startup any ideas why I

how to use class file from another war

纵饮孤独 提交于 2019-12-18 04:01:05
问题 We have two different web application and we want to extend few controllers of one war into another war. We are using maven to build the project. to include war we have given its dependency as <dependency> <groupId>com.abc.exchange</groupId> <artifactId>employer</artifactId> <version>2.3.M2-SNAPSHOT</version> <type>war</type> <scope>compile</scope> </dependency> It is unable to build giving class not found exception. Can any body help me out how to achieve this? I am getting error maven build