maven-3

maven is throwing ArrayOutOfBoundsException

孤人 提交于 2020-01-07 03:16:05
问题 Am using apache-maven-3.5.0 and Java version "1.7.0_80" on macOS Sierra... Wrote a sample maven pom.xml file as follows: <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</modelVersion> <groupId>com.example</groupId> <artifactId>myapp</artifactId> <packaging>war</packaging> <version>2.0-SNAPSHOT</version> <properties> <jdk

maven is throwing ArrayOutOfBoundsException

大兔子大兔子 提交于 2020-01-07 03:15:08
问题 Am using apache-maven-3.5.0 and Java version "1.7.0_80" on macOS Sierra... Wrote a sample maven pom.xml file as follows: <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</modelVersion> <groupId>com.example</groupId> <artifactId>myapp</artifactId> <packaging>war</packaging> <version>2.0-SNAPSHOT</version> <properties> <jdk

Sharing src/test classes between modules in a multi-module maven project

情到浓时终转凉″ 提交于 2020-01-07 02:23:05
问题 I have a multi-module Maven project. For the sake of this example, consider two modules: data consumer Module consumer has module data as a dependency. Module data declares a bunch of core classes. There are tests under src/test that use them. These tests require some long-winded object creation, so I have a class with some utility methods in it to create these objects. This utility class ( SampleDataHelper ) is in the src/test hierarchy. I also have some tests in the consumer module that

Jars Issues in Maven Spring Hibernate Project

可紊 提交于 2020-01-07 02:06:05
问题 I had made Web Application on Spring and Hibernate by taking reference from Vaannila When I specify lib name on pom.xml using eclipse, the maven repository could not include all the jars. How can I include the jars on my application? 回答1: you could use the maven install:install command which includes the jars into your maven repo mvn install:install-file -DgroupId=group_id -DartifactId=artifact_id -Dversion=version -Dpackaging=jar -Dfile=path_to_jar For this , you could try mvn package -

Maven: how to query the executable classpath?

这一生的挚爱 提交于 2020-01-06 20:04:00
问题 I have a maven project with some specified dependencies. <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.4</version> </dependency> How can I query maven to find out the path it's using for these dependencies, or the classpath I should use for independent execution? My goal is to build a wrapper which runs the program with the appropriate classpath. 回答1: Several alternatives are available in Maven: Maven Dependency Plugin (build-classpath goal) Look at

Integration tests who download files

浪尽此生 提交于 2020-01-06 06:09:03
问题 I am developing a web app who does some work, pack the data in a file and gives you back that file ( Content-Type: application/force-download ). Right now I am implementing some integration tests, where I ask for data and web app gives me back the file. Web app behaves correctly when test downloads expected data. I read this and I found it very inspiring but is that response valid when you build the file you want to download? 回答1: There are several approaches you can take. In order from best

get classifier/id of maven assembly artifact

梦想的初衷 提交于 2020-01-05 07:41:55
问题 We have a Maven extension which runs afterSessionEnd to get all the artifacts details generated during the maven build, it prints GAV of each artifact using MavenSession.getAllProjects(), Artifact.getArtifact(), getAttachedArtifacts(), getGroupID(), getArtifactId(), getClassifier(), getType() methods. It works fine generally, but if there are any assemblies being generated in the maven project it doesn't print classifier/ID of that assembly artifact even though using getClassifier() , Is

War file deployment in JBoss 4.2 server, with Maven repositories

送分小仙女□ 提交于 2020-01-05 07:14:19
问题 I am a first time maven user. The project I have needs to be deployed into JBoss 4.2 server as a war file. I realized we can eliminate Ant if we are using Maven . Previously I used to configure my build path and my jars location in build.properties file. Now using Maven I am confused how to build a war file with referenced libraries are with Maven. My directory structure is as follows: My previous build.properties file was : deploydir=C:/jboss-4.2.3.GA/server/default/deploy userlib=C:/Jar

Maven <include> wildcard match on partial folder name

依然范特西╮ 提交于 2020-01-04 05:57:11
问题 With the maven-clean-plugin I would like to remove all folders that start with "tmp". Is this possbile with maven wildcards? I have tried: <fileset> <directory>${project.basedir}</directory> <includes> <include>**/tmp*</include> </includes> </fileset> Which does not work. 回答1: This configuration works for me: <plugin> <artifactId>maven-clean-plugin</artifactId> <version>2.5</version> <configuration> <filesets> <fileset> <directory>${project.basedir}</directory> <includes> <include>**/tmp*/<

Maven 3.0.4 error on Windows 8 x64: Usage: java [-options] class [args…]

霸气de小男生 提交于 2020-01-03 19:29:05
问题 This is my first post on this forum. I have a problem with Maven 3. OS: Windows 8 Professional RTM. If I run any maven command (whatever) I always get the following answer: Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) where options include: -server to select the "server" VM -hotspot is a synonym for the "server" VM [deprecated] The default VM is server. -cp <class search path of directories and zip/jar files>