FAQ Database Discussion Community


Do not reproduce path during maven-dependency-plugin unpack goal

maven,maven-3,unpack,maven-dependency-plugin
Hi want some files that are inside a jar copied to the root folder of my java project. I used this : <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack</id> <phase>prepare-package</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem>...

Maven: Error while executing goal versions:update-properties

maven-3,versions-maven-plugin
I am running the command mvn versions:update-properties but I get the following error: Failed to execute goal org.codehaus.mojo:versions-maven plugin:2.1:update-properties (default-cli) on project <project>: only whitespace content allowed before start tag and not \uef (position: START_DOCUMENT seen \uef... @1:1) I already found a ticket in the Maven-JIRA (https://issues.apache.org/jira/browse/MNG-2057) which was fixed...

Change exec-maven-plugin Version for NetBeans Maven Java Project

maven,netbeans,maven-3
When I run a Java Maven project in NetBeans, Maven first executes the following plugin: --- exec-maven-plugin:1.2.1:exec (default-cli) @ Questionnaire --- How can I change the plugin version that is executed? I would instead like to use version 1.1.1. I have tried specifying the version in the <build> section of...

how to define path to superpom?

java,maven-3
Any maven experts out there? I inherited a huge maven project and am trying to get it to compile. Not getting very far. I go to the highest level pom.xml I can find, located in trunk directory, one level down from the main project. Then I issue command "mvn validate"....

How do I activate a Maven profile if a file does NOT exist?

maven,maven-3,profile,file-exists
I’m using Maven 3.2.3. How do I activate a profile if a file does NOT exist on the file system? I have tried the below, but discovered that the <not> syntax isn’t supported: <profile> <id>create-test-mysql-props-file</id> <activation> <file> <not><exists>${basedir}/src/main/myfile</exists></not> </file> </activation> <build> <plugins> <!-- Generate mysql datasource properties --> <plugin> <groupId>org.codehaus.mojo</groupId>...

Java app deployment to heroku using Maven failed

java,heroku,continuous-integration,maven-3,continuous-deployment
I am trying to setup the Continuous deployment process for a Tomcat based java app using Github for source code hosting, TravisCI for building the WAR file, running the unit tests and then Heroku to deploy the packaged WAR file. I tried following the tutorial from https://devcenter.heroku.com/articles/deploying-war-files-to-heroku-from-travis-ci#creating-a-java-web-application I am getting...

Does the main Nexus repository have to be named: “central”?

build,maven-3,setup-project,nexus
G'day all ... I have been looking at stackoverflow about the use of a local or cluster nexus repository. Anyway I've had a Nexus repository on my PC and my laptop for a number of years with little bother. I think more projects are using Nexus themselves and I've had...

Maven site not link to Jacoco report

maven,maven-3,pom.xml,maven-site-plugin,jacoco-maven-plugin
I can generate Jacoco report from profile 'test' and is save inside site folder. But when I execute profile 'documentacion' which contains site generation description, I get all reports link in site, except link to Jacoco report, but this report still appears inside site folder. This is part of my...

maven - multiple repository lookup configuration

maven,maven-2,maven-3
I'm using maven v3.0.1 for my projects. I've projects which depends on artifacts from a corporate remote repository. Also I had a local archiva repository in company which hold local artifacts, which are not in to corporate remote repository. I would like to make the settings.xml in such a way...

How can I change a app-engine username/credentials in Maven?

google-app-engine,maven,maven-3
I worked on app-engine with a google account (entered to maven when doing mvn appengine:update). I now need to work with a different google account, trying to upload the project give an access error because Maven is caching the user token and my credentials.. How can I switch user?...

Why is fileToString not reading the contents of the file properly?

java,maven,testing,maven-3,geotagging
I was following the instructions for CLAVIN installation. When I tried to build the CLAVIN package, it would display a 'Build Failure' after the TextUtilsTest, which checks that the contents extracted from a file are exactly the same as an expected String. Here's the code of the TEST, and here's...

Renaming static files when building WAR file using Maven

java,maven,maven-3,maven-plugin,maven-war-plugin
I want to rename static files when building my WAR file using maven-war-plugin, with version number. For intance, in my project I have a file: src/main/webapp/css/my.css I want it to appear in the WAR file as: css/my-versionNumber.css The same question was already asked (see Rename static files on maven war...

How to automatically set Maven compiler plugin based on $JAVA_HOME env variable?

environment-variables,maven-3,java-home,maven-compiler-plugin
I’m using Maven 3.2.3. I have a multi-module project and currently have my Maven compiler plugin set as such <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.6</source> <target>1.6</target> <compilerArgument>-proc:none</compilerArgument> <fork>true</fork> <!-- <debug>true</debug>...

Maven reactor builds in order that doesn't satisfy all dependencies

maven,maven-3
I am having trouble with build ordering in a SNAPSHOT build using Maven. The reactor is building all of the jars in an invalid order. The following is an example structure to recreate the issue (the project I'm having issues with is much larger, >100 jars): pom.xml [reactor] parent/pom.xml [parent]...

JAXB Release Documentation stating contrary information about Compile and Runtime Jars

java,xml,jaxb,jax-ws,maven-3
Referred to the following JAXB release documentation. https://jaxb.java.net/nonav/2.2.11/docs/release-documentation.html#section-2232462900667844 It states that it needs following jars at Runtime jaxb-api.jar, jaxb-core.jar, jaxb-impl.jar, But in the next line, same documentation also states that it does not needs same jars at Runtime. This seems incorrect information. What is correct information? Where can it be...

How to do Selenium test on Bamboo

selenium-webdriver,maven-3,bamboo
We are trying to run some Selenium tests using Selenium CI . We are using maven to build the project and using Selenium web driver. I followed an Blog post in the link. http://www.3pillarglobal.com/insights/how-to-use-selenium-in-continuous-integration-testing#comment-38432 as a reference When I run the maven project locally(without Bamboo) it worked fine. But when...

maven encoding resources spring messageSource

spring,encoding,maven-3,maven-resources-plugin
Having a spring project with this messageSource: @Bean public MessageSource messageSource() { ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); messageSource.setBasenames("Language", "original/Language"); messageSource.setDefaultEncoding("UTF-8"); messageSource.setFallbackToSystemLocale(true); return messageSource; } And a test as: @Test public void getMessageFromOriginal() { String message = messageSource.getMessage("javax.portlet.description.2", null, new Locale.Builder().setLanguage("es").build());...

Cargo:run If you specify a containerId, you also need to specify a containerUrl

maven,tomcat,tomcat7,maven-3,cargo
I am trying to run tomcat though cargo. Tomcat is already installed. cargo:deploy is working fine but when I try cargo:run I get the following error If you specify a containerId, you also need to specify a containerUrl. If I specify a containerURL I get the following error [ERROR] Failed...

Maven Project Requires Local Dependency to be Built

java,maven,build,maven-3,pom.xml
I have 2 Maven projects, A and B. Project A is entirely independent, while B requires A as a dependency. Currently, B is getting A from the maven repository: <dependency> <groupId>com.myproject</groupId> <artifactId>projectA</artifactId> <version>2.0.0-SNAPSHOT</version> </dependency> What I would like to do is set up the dependency such that B can reference...

Maven dependency plugin copy jar with dependencies

maven,jar,maven-2,maven-3,maven-plugin
I'm trying to copy a jar from my local repository into another project as described here: http://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html However my jar is coming out of maven-assembly-plugin as a "jar with dependencies", which puts the regular jar and the assembled jar in my local repo. The jar name looks something like: example-test-0.0.1-SNAPSHOT-jar-with-dependencies.jar...

Staging of Repository within profile ID='X' is not yet started

maven-3,nexus
Trying to deploy on a staging repository leads on the maven side to 400 , ReasonPhrase:Bad Request and the server log contains Staging of Repository within profile ID='X' is not yet started! It makes no difference using maven-deploy-plugin or maven-release-plugin. All three leads to the error from above. My deployment...

For a Maven 3 plugin what is the latest way to resolve a artifact

maven,maven-3,maven-plugin
What is the latest way of resolving an Artifact within a Maven 3.2.5 plugin. ArtifactResolver and ArtifactFactory(depreciated) are in the compat library which implies that there is a newer/better way of resolution, but I can not find any examples, docs or searches that do not use the above. Thanks Michael...

Run Maven plugin just before deploy to remote repo

java,maven,maven-3
In my maven project I use the pgp plugin to sign my jars. I need to do this only when deploying to remote repo, but not when installing to local repo. So I tried to set the phase to deploy. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <version>1.1</version> <executions> <execution> <id>sign-artifacts</id> <phase>deploy</phase> <goals> <goal>sign</goal>...

grails maven-functional-test failsed to execute

spring,grails,maven-3
Have this exception when run mvn clean install my grails app. Grails version 2.4.4 Failed to execute goal org.grails:grails-maven-plugin:2.4.4:maven-functional-test (default-maven-functional-test) on project nrm: Execution default-maven-functional-test of goal org.grails:grails-maven-plugin:2.4.4:maven-functional-test failed: java.lang.reflect.InvocationTargetException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.interceptor.CacheInterceptor#0': Cannot resolve...

what does having two goals in same plugin mean in maven?

maven,maven-3,maven-plugin
Here is an example of pom.xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.18.1</version> <configuration> ...... </configuration> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> <phase>integration-test</phase> </execution> </executions> </plugin> </plugins> what does having two...

Google Endpoints using only inside App Engine

eclipse,google-app-engine,gwt,maven-3,m2eclipse
When we create End Point, it has external address to access it. So, if I try to call it from another End Point it will use some traffic. I want to create End Point available from outside (Api), and another end point for accessing to datastorage. Second End Point shouldn't...

Local Nexus Maven repository for common java libraries

maven,maven-3,dependency-management,nexus,sonatype
We have a Nexus install that has a collection of commonly used java dependencies (commons-codec, jodatime etc.) The directory structure is similar to the below commonjavalibraries | |_ commons-codec | |_commons-codec | |_1.2 |_ commons-compress |_commons-compress |_1.3 I am in the process of adding the latest version of these dependencies...

how is the properties set in this pom.xml?

maven,maven-3
This is the snippet of pom.xml from my project. <properties> <Port>2020</Port> <threads>20</threads> <test.suite /> <test.suite.path /> <useTag /> <useTestCase /> <args>-Dthreads=${threads} -Dtest.suite.path=${test.suite.path} -Dappenv=${test.app.env} -Dtest.suite=${test.suite} -DuseTag=${useTag} -DuseTestCase=${useTestCase}</args> </properties> when maven build is made, I am wondering how the variables test.suite, test.suite.path, useTestCase are set? I do not see it...

Unable to import maven project in IntelliJ14

maven-3,intellij-idea-14
I'm trying to import the Maven projects from IntelliJ button (the one with the arrows in circle), but I get the following message "Unable to import maven project. See logs for details", as shown in the following picture If I go into the log, I see: 2015-06-01 11:16:46,932 [ 89176]...

Best way to add local dependency to Maven project

java,maven,maven-3
There are a lot of questions about this, but the answers seem to contradict each other. So I wanted to ask it for my version of Maven (3.0.4). I have a JAR file that's not part of any maven repository. It's a local dependency. I understand there are two ways...

Spark/Java: NoClassDefFoundError in GSON dependency

java,apache-spark,gson,maven-3
I have a small Spark project using a JAR file, which I am packaging with Maven. I am using GSON to work with JSON files, and I specifically need the JsonReader class. I added the GSON dependency, and when I run it as a standard Java project it works fine....

Maven dependencies not included in project deployed on Websphere Liberty

java,eclipse,java-ee,maven-3
I am using Eclipse Luna, Maven 3 and Websphere Liberty 8.5.5. I have added websphere liberty server in eclipse. The EAR/WAR project deployed in liberty does not include maven dependencies in WEB-INF/lib of WAR. If I export EAR or WAR the exported file has all the dependencies included. What could...

Maven project failed to build

java,eclipse,maven,google-app-engine,maven-3
I am new to Maven projects. I imported an existing Maven project to eclipse, then made a new configuration. I tried running the application then but the console shows [ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.4:devserver (default-cli) on project helloworld: The plugin com.google.appengine:appengine-maven-plugin:1.9.4 requires Maven version 3.1.0 -> [Help 1] [ERROR]...

maven-dependency-plugin:unpack Error

maven-3,maven-dependency-plugin
I'm trying to extract some .exe files from a dependency jar file and put them under ${project.build.directory}/classes/. But when I execute: mvn clean compile dependency:unpack I get: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:unpack (default-cli) on project simple: Either artifact or artifactItems is required -> [Help 1 I have verified that the...

Cucumber-JVM Maven Integration issue

testing,maven-3,cucumber-jvm
I was able to run Cucumber-JVM tests using @RunWith & @CucumberOptions tags.But I am unable to execute the tests using Maven. Can somebody point me in the right direction ? I am trying to use maven sure fire plugin, after scouring the internet.I do think, I am making a mistake,...

Create a zip file and add it to a war file with maven

maven,maven-3,maven-assembly-plugin
I have some example RESTful client projects that go along with a RESTful Java web service I am working on. Basically, these projects should not be built but instead zipped up and included in the war file so that they will be available as static resources when the war file...

Intellij debugger does not stop at breakpoints

java,intellij-idea,maven-3,weblogic12c
I must be doing something wrong here. I am new to intellij. Making switch from eclipse. I have a JAX WS application that runs on weblogic. The artifact to deploy is an ear file. I have been struggling to get debugger on intellij working. I have the ultimate edition. I...

If version of the artificat id is not changed,will the dependent project pick up the latest changes

maven,maven-3
I have two maven projects p1 and p2. p2 is dependent on p1. now if i do some code changes in project p1 and without changing the version of artifact publish it to repository, will the p2 project will pickup the latest changes. or do i need to change the...

Why won't maven-antrun-plugin run?

maven,ant,maven-3,maven-antrun-plugin
I'm having trouble getting the antrun plugin to run. I have this configuration in my pom: <project> ... <build> ... <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.4</version> <executions> <execution> <phase>compile</phase> <goals><goal>run</goal></goals> <configuration> <target> <echo message="Hello, maven"/> </target>...

Linux command (unzip -p) run with exec-maven-plugin

maven,command-line,maven-3,unzip,exec-maven-plugin
I have my.zip file under project’s target/ folder. MyProject/ -target/ -my.zip -pom.xml Inside my.zip there is a file named names.txt. If I run linux command under project root: unzip -p target/my.zip names.txt > target/names.txt I successfully get the names.txt extracted to target/ folder: MyProject/ -target/ -my.zip -names.txt -pom.xml I want...

Manually attach main artifact if built by maven-assembly-plugin

java,maven-3,maven-assembly-plugin
I am having problems building a maven project. I have a requirement to produce deterministic jar files, which must be binary-consistent across different builds and versions, in case there are no source code changes in between these builds. For the purpose, I have used this article for guidance. I have...

ANT or MAVEN for my selenium project? [closed]

maven,ant,selenium-webdriver,maven-3
I'm developing a hybrid framework for GUI automation. I'm using TestNg. I'd like to use ANT / MAVEN. What are the factors that we need to take into account before we make the decision? I have read the difference between ANT and MAVEN online. I have a theoretical understanding of...

Maven hamcrest parent depedency failed to resolve

maven,maven-3,dependency-management
I have the following POM with a single dependency: <?xml version="1.0" encoding="UTF-8"?> <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.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.xxx</groupId> <artifactId>mavenproject1</artifactId> <version>1.0-SNAPSHOT</version>...

How can I make the ProGuard Maven plugin use the most recent ProGuard version?

java,maven,maven-3,proguard,obfuscation
I have a pom.xml file given below. When I run mvn clean install, I get the error [proguard] Error: Can't read [C:\Program Files\Java\jdk1.8.0_20\jre\lib\rt.jar] (Can't process class [com/oracle/net/Sdp$1.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7))) I tried to upgrade the ProGuard version and set it to 5.2 in the...

Dots in function parameter name

maven,powershell,maven-3,powershell-v3.0
Is a parameter name with dots possible in powershell? The obvious approach - see Dmaven.failsafe.debug fails: function mvn-failsafe-debug { param ( [string] $Dmaven.failsafe.debug="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,address=Maven,suspend=n", [parameter(Position=0, ValueFromRemainingArguments=$true)] $args ) & "$env:M2_HOME\bin\mvn.bat" $args } ...

Providing resources files in Maven module

java,maven-3,m2eclipse
I am developing a new maven module and have some problems with resolving the dependencies. The goal is to create an maven object that provides my jar archive and a bunch of other resources. I created my pom.xml and installed the jar archive with install:install-file to the repository. That works's...

Running Jar does not use jars from lib/* when packaged with mvn clean package

spring,spring-boot,maven-3,netflix,netflix-eureka
I have spring-boot application, which is first packaged to jar using mvn clean package I am trying to run it as java -jar target/bootstep-0.0.1-SNAPSHOT.jar But it fails due to following error. 2015-04-24 16:06:45.425 INFO 27324 --- [ost-startStop-1] c.s.j.api.core.PackagesResourceConfig : Scanning for root resource and provider classes in the packages: com.netflix.discovery...

How to upgrade liferay services from 6.0 archetype to 6.2?

liferay,maven-3,best-fit
I am currently working on liferay upgradation from 6.0 to 6.2.2 GA3. I tried upgrading the services portlet. The services portlet of 6.0 version is built using mvn services-portlet-archetype whereas for 6.2 version the archetype is liferay-servicebuilder-archetype. The difference is that in 6.2 liferay-servicebuilder-archetype there are two modules: Module 1:...

maven activate by property value and version

maven,maven-3
is there a way to activate a profile by property but instead of checking a specific value check for a version range. here is what i am trying to do <properties> <frontend-maven-plugin.version>0.0.16</frontend-maven-plugin.version> </properties> ... ... <profile> <id>new_version_of_frontend</id> <activation> <property> <name>maven.version</name> <value>3.1.0</value> </property> <properties>...

Mave-assembly-plugin: customize descriptor to exclude a folder

maven,maven-3,maven-plugin,maven-assembly-plugin
I have the following directory structure: MyProject/ - temp/ - cat_A/ - tmp/ - file_A - cat_B/ - tmp/ - file_B I am using maven-assembly-plugin. I want to create a tar.gz file with the content to be like following: output/ - cat_A/ - file_A - cat_B/ - file_B I tried...

Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved

maven,maven-2,maven-3,maven-plugin,maven-release-plugin
I have install maven in my machine. I have properly set the class-path and maven home folder. Every time I execute mvn clean install, it gives me exception. I have also tried to delete the .m2 folder but the same result. mvn -version output Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00) Maven...

Maven prefixing WEB-INF/classes into JAR dependency

maven-3,spring-boot
Update: Solved! Posted solution as my own answer. Will be accepting it in two days when I'm allowed to. A little back story I've been chasing down this rabbit hole for the past few days, and my question has drastically changed shape over that time. Initially, I thought I...

Exclude class path reference from MANIFEST.MF file

java,maven,jboss7.x,maven-3
I was getting some WARNings while trying to deploy the EARs in JBoss 7.1.1. 15:41:32,028 WARN [org.jboss.as.server.deployment] (MSC service thread 1-6) Class Path entry lib/commons-fileupload-1.0.jar in "/C:/myEar.ear/myWar.war" does not point to a valid jar for a Class-Path reference. The issue is clearly explained in this SO thread. I tried removing...

Maven -pl ! doesn't exclude submodules of from the build

maven,maven-3
I use maven 3.2.3. I have a multi-module project with three levels of nested modules. I want to build all first-level modules(with their submodules) except one. For this task I tried to use -pl option and specifying the module I want to exclude from the build using !moduleName. What I...

Maven: how to build jar and include as a dependency

eclipse,maven,maven-3
I have a multi module project. I am using eclipse and Maven 3. I wish to first build a jar (a standalone project with its own pom). This is not the problem. The problem is this jar is included as a dependency of my multi-module EAR project (used by two...