maven-antrun-plugin

Maven: Output JAR with arbitrary extension

半世苍凉 提交于 2019-12-11 04:33:19
问题 I have a Java project that, when mvn install is executed on it, generates a JAR file. So far so good. After that generation, I'd like to rename the resultant JAR file to something with an arbitrary extension. For example, say the resultant JAR that is generated is called "Foo.jar", I'd like to rename it to "Foo.baz" I'm trying to ascertain the magical plugin combo that will allow me to do this. So far, I've tried the following, based on this SO answer: <project> ... <build> <finalName>Foo<

Replace task in Maven Antrun Plugin

旧巷老猫 提交于 2019-12-10 22:26:41
问题 I am using antrun plugin in my maven build to replace a token @version@ in some of the JSP files with the application version. This is what I am doing: <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.6</version> <executions> <execution> <phase>compile</phase> <configuration> <target> <echo>${displayVersion}</echo> <replace file="src/main/webapp/admin/decorators/default.jsp" token="@version@" value="${displayVersion}"/> </target> </configuration> <goals> <goal>run</goal> <

Maven: No marketplace entries found to handle castor, antrun, and ear plugins

喜欢而已 提交于 2019-12-10 12:43:03
问题 I am importing a maven project into Eclipse. I have the m2e plugin installed and it is pointing to maven 2.2.1 on my machine. I am getting these three errors: No marketplace entries found to handle castor-maven-plugin:1.0:generate in Eclipse No marketplace entries found to handle maven-antrun-plugin:1.1:run in Eclipse No marketplace entries found to handle maven-ear-plugin:2.3.1:generate-application-xml in Eclipse Any resources provided would be greatly appreciated. Thanks 回答1: You can define

How to do input task in maven antrun plugin

旧街凉风 提交于 2019-12-10 09:46:22
问题 I created a maven project and i'm trying to run an external script. In this external script, i use read command to ask a question and get an answer. It works if i do a sudo mvn package with exec-maven-plugin But, but, but : If i do a sudo mvn package , my script doesn't stop at read command. If i do a sudo mvn release:prepare with exec-maven-plugin, my script doesn't stop at read command. If i do a sudo mvn release:prepare with maven-antrun-plugin, my script doesn't stop at read command. And

How to register a custom built jar file as maven main artifact?

我们两清 提交于 2019-12-10 01:38:24
问题 I have a project expected to deliver a jar file: <packaging>jar</packaging> but the jar is built in a custom way, so the default packaging done with jar:jar has been disabled <plugin> <artifactId>maven-jar-plugin</artifactId> <version>2.3.2</version> <executions> <execution> <id>default-jar</id> <phase>none</phase> </execution> </executions> </plugin> but then when I want to apply shade:shade on the existing jar I get an error The project main artifact does not exist. I assume that maven

Maven:install jar file during build process

﹥>﹥吖頭↗ 提交于 2019-12-10 01:33:48
问题 I have got a requirement as follows. I need to run ant build file during maven build process. I need to invoke the build.xml from my pom.xml file. I have done that using maven-antrun-plugin. Now I need to install the ant build generated jar file automatically into my local repository before maven compiles my project source. I tried using build-helper-maven-plugin but it did not help. Either I am doing something wrong, or i am not doing right. Please help. Update Thank you. ant maven tasks

Run a Ant task in Maven only if a property is set

倾然丶 夕夏残阳落幕 提交于 2019-12-09 11:56:34
问题 My pom.xml is running an Ant task to deploy a file using FTP. However, this deployment must be only done if the -Dftp=true argument is given in the Maven command (i.e. mvn clean install -Dftp=true ). Thus, I wrote the following code: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.2</version> <executions> <execution> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks if="ftp"> <echo

Run ant task in maven build phase before war is packaged?

空扰寡人 提交于 2019-12-08 01:20:04
问题 When deploying a webapp I need to concat some files, currently this is achieved via an ant task. I'm trying to run this task in the maven build process using something like the following: <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <phase>package</phase> <configuration> <target> <move file="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/log4j.dev.properties" tofile="${project.build.directory}/${project

How to call ant task to process webapp files after “copying webapp resources” and before “building war” steps in package phase?

倾然丶 夕夏残阳落幕 提交于 2019-12-07 12:56:36
问题 I'm migrating from ant to maven. However I have a custom build functionality for process web resources that I don't want to adapt yet to maven (the cost is very high) so I'm using ant run plugin. I want to process some of the resource files calling the ant task. This needs to happen after the "copying webapp resources" step and before the "building war" steps within the phase package. When I run my ant task, with the phase being "package" <plugin> <groupId>org.apache.maven.plugins</groupId>

Maven and Ant Can't run Java - CreateProcess error=206, The filename or extension is too long

我是研究僧i 提交于 2019-12-07 05:28:15
问题 When maven via antrun executes this java code I get the dreaded error=206, The filename or extension is too long <java classname="com.me.api" failonerror="true" fork="true" maxmemory="128m" output="${wsdlFile}.out"> <arg value="${className}" /> <arg value="${name}" /> <arg value="${wsdlFile}" /> <classpath> <path refid="maven.test.classpath" /> </classpath> 回答1: Maven creates lengthy classpaths due to the structure and location of the local maven repo. We need to use a pathing jar. Convert