maven-plugin

How do I execute a program using Maven?

瘦欲@ 提交于 2019-12-17 02:55:16
问题 I would like to have a Maven goal trigger the execution of a java class. I'm trying to migrate over a Makefile with the lines: neotest: mvn exec:java -Dexec.mainClass="org.dhappy.test.NeoTraverse" And I would like mvn neotest to produce what make neotest does currently. Neither the exec plugin documentation nor the Maven Ant tasks pages had any sort of straightforward example. Currently, I'm at: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version

Difference of Maven JAXB plugins

会有一股神秘感。 提交于 2019-12-17 02:53:32
问题 I have determined that two JAXB plugins for Maven 2 exist, with some different configurations. The one is from Sun: http://jaxb.dev.java.net/jaxb-maven2-plugin/, the other from Mojohaus: http://mojohaus.org/jaxb2-maven-plugin/ Which of these two plugins can be recommended? Thanks Matt. On my little research project, I found that there's quite another plugin comming from the sunners: <groupId>com.sun.tools.xjc.maven2</groupId> <artifactId>maven-jaxb-plugin</artifactId> and that one: <groupId

Eclipse 'refresh automatically' and Maven build interference

梦想的初衷 提交于 2019-12-14 00:54:18
问题 I recently configured Eclipse (ver. 3.6) in order to make it automatically refresh projects in the workspace (Windows > Preferences > General > Workspace > Refresh Automatically). Since I changed this configuration I have the following problem when I try to run Maven (Maven install from Eclipse) to build a big project: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project ProjectName: Failed to clean project: Failed to delete C:

Maven, run a java method or script before war is about to be built

╄→гoц情女王★ 提交于 2019-12-13 20:43:00
问题 I am thinking of using a template engine to generate the web.xml and other things. Is there as way to to run a java file or a script before the maven install command ? Or before the war is generated. I am not sure what the phase should be, but basically before anyone else looks at the web.xml so I can touch it to make a new valid one . 回答1: You can use the exec-maven-plugin to run either a program/script (using the exec goal) or a Java program (using the java goal). The phase immediately

antlr4 import maven eclipse combination does not work can't find or load grammar

六月ゝ 毕业季﹏ 提交于 2019-12-13 19:19:53
问题 With ANTLR 4.7 ANTLR 4.7 maven plugin Eclipse Neon 4.6.2 i am trying to use the grammar import feature of ANTLR4. see https://github.com/BITPlan/com.bitplan.antlr with the example iri grammar https://github.com/BITPlan/com.bitplan.antlr/tree/master/src/main/antlr4/com/bitplan/iri That grammar is basically the attempt to split the https://github.com/antlr/grammars-v4/blob/master/iri/IRI.g4 into three parts: parser lexer imported basic lexer parts At this point I am getting the error message:

Maven war plugin not able to exclude libs in exploded war format

a 夏天 提交于 2019-12-13 14:27:01
问题 I am using maven war plugin to exclude some common jar and put them in the classpath. I am able to generate war file properly which excludes specified libs and add them in the classpath but exploded war directory still contains excluded libararies. How can I generate exploded war file which use configuration of maven war plugin. <project> <modelVersion>4.0.0</modelVersion> <groupId>com.ekaplus.ctrm.mdm</groupId> <artifactId>core-presentation</artifactId> <version>1.0</version> <packaging>war<

XML DTD/Schema validation in Maven

六眼飞鱼酱① 提交于 2019-12-13 13:01:44
问题 How can I validate XML documents during a Maven build against a DTD or a XSD Schema? 回答1: There is a xml-maven-plugin that can check whether XML files are matching an XML schema but I don't think it can generate reports. 回答2: The validate goal of the xml-maven-plugin will check for well-formedness and optionally validate against a schema. The build will fail if the validation fails. The plugin does not produce any report, what would you want in a report out of interest? information about the

mvn javadoc:javadoc failing on just ONE of my Module project

柔情痞子 提交于 2019-12-13 08:11:16
问题 I have really very strange problem with my Sub modules project. Project Structure something like as below. TestPomProject * DAOProject * SchemaProject * EJBProject * EarProject If i execute "mvn javadoc:javadoc" command on these projects ( DAOProject, SchemaProject, EarProject ) It's working fine and completed successfully. But when i execute this command at EJBProject it's giving me following exception and there isn't any different entry for javadoc in EJBProject all having same entry for

Liquibase maven diff not showing differences

心已入冬 提交于 2019-12-13 07:14:17
问题 I have just started using Liquibase, and wanted to use the maven plugin to show differences between two different databases (which I know for a fact are different because I have created a random table called 'wallawalla' in one of them) but Liquibase diff is showing no results. Here is my pom.xml: <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/xsd/maven-4.0.0

How to get POM property from org.apache.maven.artifact.Artifact

☆樱花仙子☆ 提交于 2019-12-13 05:29:05
问题 I am traversing a dependency graph of my main pom in a plugin using org.apache.maven.shared.dependency.graph.DependencyGraphBuilder.buildDependencyGraph() and the resulting org.apache.maven.shared.dependency.graph.DependencyNode However, once I reach a dependency with a specific groupId I need to access a maven property declared in its pom. How can I access the pom via the Artifact or the DependencyNode object? 回答1: Let me answer this groovy style .... (using a script written for GMaven) I'll