maven-2

running mvn using ProcessBuilder

好久不见. 提交于 2019-12-02 02:06:16
问题 I had created a class which create process using ProcessBuilder and then launch process ProcessBuilder pb = new ProcessBuilder("mvn","exec:java","-Dexec.mainClass="+"FunnyClass"); Now when I m running this class on linux box, it run fine, but on windows it give me error, stating something like 'mvn' not found, I need to change to ProcessBuilder pb = new ProcessBuilder ("mvn.bat","exec:java","-Dexec.mainClass="+"FunnyClass"); But if I am running command on command prompt "mvn exec:java -Dexec

How to manipulate Manifest file with maven

岁酱吖の 提交于 2019-12-02 00:59:51
I have an EAR file built with maven. The EAR contains several jars and I need to add a line in the manifest file for just one of these jars. I know of the maven-jar-plugin option (manifestEntries) but this is good for a single standalone jar, not one that is inside an EAR. If you take a deeper look into maven-ear-plugin configuration you will find the archive configuration part which is exactly intended for such purposes. This can be added to the configuration of the maven-ear-plugin: <archive> <addMavenDescriptor/> <compress/> <forced/> <index/> <manifest> <addClasspath/>

struts 2.3.16.1 upgrades giving TypeMismatchException for struts xwork and SimpleMessageListenerContainer in Spring framework

时间秒杀一切 提交于 2019-12-02 00:35:00
I have been upgraded from struts 2.0 to 2.3.16.1 for get the latest security fixes in struts to my web application when I upgraded deployed in tomcat server it gives following errors: Caused by: Unable to load configuration. - interceptor - jar:file:/C:/Projects/apache-tomcat-7.0.50/webapps/myweb/WEB-INF/lib/struts2-core-2.3.16.1.jar!/struts-default.xml:167:106 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445) at org.apache.struts2.dispatcher.Dispatcher

How to create maven uber jar which includes dependencies with scope provided

梦想的初衷 提交于 2019-12-02 00:30:43
<plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <archive> <manifest> <mainClass>com.XXXX.XXXXOfflineApp</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> I have the above code piece to create an jar with dependencies, but in my pom i also have some dependencies with scope provided but these are not included in the uber jar, Well I cannot change the

maven-jaxb2-plugin episode of same project in Maven, possible?

廉价感情. 提交于 2019-12-02 00:28:54
I have a basic.xsd and two other A.xsd and B.xsd . A.xsd and B.xsd get converted into two different java packages, therefore I need two Maven executions of the same plugin. Both XSDs refer to basic.xsd for some shared classes. If basic.xsd would come from a different project I could solve this problem really nicely through using episodes to prevent duplicate classes. But how can I refer to the current project? My first execution of the plugin is to generate only classes from basic.xsd into its own java namespace. After that the executios of A.xsd and B.xsd should know about the stuff generated

running mvn using ProcessBuilder

允我心安 提交于 2019-12-02 00:25:13
I had created a class which create process using ProcessBuilder and then launch process ProcessBuilder pb = new ProcessBuilder("mvn","exec:java","-Dexec.mainClass="+"FunnyClass"); Now when I m running this class on linux box, it run fine, but on windows it give me error, stating something like 'mvn' not found, I need to change to ProcessBuilder pb = new ProcessBuilder ("mvn.bat","exec:java","-Dexec.mainClass="+"FunnyClass"); But if I am running command on command prompt "mvn exec:java -Dexec.mainClass=FunnyClass", it run fine. So why I need to give mvn.bat in processbuilder. Is there any

Error in POM.xml

喜夏-厌秋 提交于 2019-12-01 23:31:39
I am trying to build the openNMS in eclipse helios using maven. After importing the source using "import existing maven project" i get the around 10k errors. Also i have some error in pom.xml itself, i thought fixing it could reduce the no of errors. The error in pom.xml is maven-resources-plugin prior to 2.4 is not supported by m2e. Use maven-resources-plugin version 2.4 or later. Iam referring to http://www.opennms.org/wiki/Eclipse_and_OpenNMS for building the openNMS Iam using maven available at http://www.eclipse.org/m2e/download/ It would help if you told us which versions of Eclipse &

Error with Jboss while deploying a jsp/servlet web app “com.sun.faces.config.ConfigureListener” Error

依然范特西╮ 提交于 2019-12-01 22:52:39
I am working on JSP/Servlets. The web app is to be deployed on Jboss 6. I am using Java 1.6, Eclipse and Maven2. I do not refer to JSF anywhere in my code. My project doesnot have JSF involved anywhere, but when I try to deploy my webapp WAR I get an error that says : 21:55:44,448 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/UltimateSMS-1 21:55:44,493 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/UltimateSMS-1]] Error configuring application listener of class com.sun.faces.config.ConfigureListener: java.lang.ClassNotFoundException:

Why might Maven ignore updated classes during install?

梦想的初衷 提交于 2019-12-01 22:40:17
I've been seeing odd behaviour from my Maven 2.2.1 installation whilst doing war installs. Occasionally, I will update a class but the updated version is not packaged up in the artifact produced by mvn install. So far, I have determined that an updated .class file is produced in the target directory, and that the class of the same name in the produced .war is not the same (different date modified, different size) Running Maven from the command line with the -X flag produced debug output for the class like: [DEBUG] * WEB-INF/classes/mypackage/MyClass.class is up to date. I think I've also had

What's the “right” way to (temporarily) exclude sources from a maven build, and is there an easy way to do it from Eclipse?

≡放荡痞女 提交于 2019-12-01 21:40:39
问题 I'm new to maven, and I don't have a whole lot of experience with Eclipse either. To exclude java files from building in Eclipse, I right click the files and choose Build Path -> Exclude. This works great for the "on-save" compilation in Eclipse, but it does not propagate to the maven project, so when I build my project with mvn install, it tries to compile the excluded sources. I've done a few searches and the results point me to the compiler plugin and the <excludes> functionality, but