FAQ Database Discussion Community


What is the difference between “mvn clean install” & “mvn eclipse:clean eclipse:eclipse” command?

maven
I have a maven project in eclipse. I use mvn clean install for installing dependecies in pom.xml. I want to know what mvn eclipse:clean eclipse:eclipse command does and also the difference between these two?...

How to use jnaerator in a sbt project

java,c++,maven,sbt,jnaerator
I work on a Scala project that uses c++ code, using sbt. Once compiled, this c++ code is imported into Scala through Java code that uses jna. Now, currently the Java wrapper are manually written, and I like to automatize this. I've found jnaerator that can do that, but I...

how do you download files via ant though proxy [duplicate]

java,maven,ant,proxy
This question already has an answer here: Ant GET task and proxy 1 answer I am using ant which uses an build.xml file. This is the command: java version : 1.8.0 ant version: 1.7.1 CLASSPATH=/app/hbase-0.94.27/lib/hadoop-core-1.0.4.jar CFLAGS=-m64 CXXFLAGS=-m64 ant compile-native tar it hangs here: Buildfile: build.xml ivy-download: [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar...

Switching branches in Git with external dependencies

git,maven,dependencies,git-branch
Has anyone had to deal with the issues of switching git branches in a project that has Maven (or any other external) dependencies? For example, suppose that in one branch I have a maven dependency, and in another I don't (or have a different version required). Would I have to...

Error in `mvn jgitflow:release-finish` mutli-module build (due to wrong compilation order)

maven,jgitflow-maven-plugin
I'm trying to use JGitflow to create a release for my project. Unfortunately, when I run mvn jgitflow:release-finish, I get the following error: Unable to find resource 'org.jorlib:jorlib-core:jar:1.0' in repository central (http://repo1.maven.org/maven2) [WARNING] The dependency: org.jorlib:jorlib-core:jar:1.0 can't be resolved but has been found in the reactor. I'm not sure how...

@RestController throws HTTP Status 406

java,spring,rest,maven
I am working on a basic Hello World program using Spring and Restful webservices. But when I try to call my service I am getting below error message: HTTP Status 406 - description - The resource identified by this request is only capable of generating responses with characteristics not acceptable...

sonar-maven-plugin 5.1.1 not found

maven,sonarqube
I've just installed the latest version of SonarQube (5.1.1) and when I try to run the sonar:sonar target, I get an error: Embedded error: Unable to build project for plugin 'org.codehaus.sonar:sonar-maven-plugin': POM 'org.codehaus.sonar:sonar-maven-plugin' not found in repository: Unable to download the artifact from any repository org.codehaus.sonar:sonar-maven-plugin:pom:5.1.1 I've checked here: http://mvnrepository.com/artifact/org.codehaus.sonar/sonar-maven-plugin...

maven not working with Java on Mac OS X

java,osx,maven
I downloaded the latest version of JDK8 for Mac OS X and also installed maven. However, I seem to be having an incompatibility between Java and maven: myusername$ mvn -version Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at...

How can I re-open a Maven project in Eclipse?

eclipse,maven
I was working on a Maven project. I closed Eclipse, and now I don't know how to re-open it.

HTTP 415 Unsupported Media Type

java,web-services,maven,jax-rs
I have created a sample web service to make a post call. I am using Jersey JAX-RS, and Maven. web.xml <servlet> <servlet-name>provider-serlvet</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> <init-param> <param-name>javax.ws.rs.Application</param-name> <param-value>org.is.ws.provider.rest.ProviderAggregateApplication</param-value> </init-param> <init-param>...

Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.fs.CanSetDropBehind issue in ecllipse

maven,hadoop,apache-spark,word-count
I have the below spark word count program : package com.sample.spark; import java.util.Arrays; import java.util.List; import java.util.Map; import org.apache.spark.SparkConf; import org.apache.spark.api.java.*; import org.apache.spark.api.java.function.FlatMapFunction; import org.apache.spark.api.java.function.Function; import org.apache.spark.api.java.function.Function2; import org.apache.spark.api.java.function.PairFlatMapFunction; import org.apache.spark.api.java.function.PairFunction; import...

Flink error - org.apache.hadoop.ipc.RemoteException: Server IPC version 9 cannot communicate with client version 4

maven,hadoop,flink
I am trying to run a flink job using a file from HDFS. I have created a dataset as following - DataSource<Tuple2<LongWritable, Text>> visits = env.readHadoopFile(new TextInputFormat(), LongWritable.class,Text.class, Config.pathToVisits()); I am using flink's latest version - 0.9.0-milestone-1-hadoop1 (I have also tried with 0.9.0-milestone-1) whereas my Hadoop version is 2.6.0 But,...

Importing an OSGI bundle into eclipse

java,eclipse,maven,dependency-management,osgi-bundle
I try to import this OSGI bundle [2]enj-library into eclipse (after compiling it with Maven) , I used: "File > Import...> Plug-in Development > Plug-ins and fragments" and I imported the binary but I got the following unresolved dependencies: These dependencies were mentionned in pom.xml: <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>1.2.1</version> <extensions>true</extensions>...

setting JAVA_HOME to the JDK location mac osx 10.9.5

java,osx,maven,java-home
I followed this thread to solve my problem, I have the same problem with a different version of JDK and for some reason it didn't work. I still get -bash: JAVA_HOME: command not found when I type JAVA_HOME to my terminal. I have JDK1.8.0.45 located at Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home which I can...

Retrieving command line -D options in Java

java,maven,jenkins,jenkins-plugins
I have clean integration-test -DclassId=appas a maven goal in a Jenkins Maven Job. How can I retrieve this in Java using System.getenv();? When I do this I am only seeing null....

Maven can not find the 'main' class for my Java app

java,maven
I am new to Java and this is my first time using Maven. I have tried to build a working pom.xml file by stitching together various things I've read and copy-and-pasting them to pom.xml. This is not working. I put my java files in this folder: src/main/java/com/ollio/nlp/ my main class...

Displaying version and date of build in the xhtml page from manifest in run time

maven,glassfish,manifest,war
Enumeration<URL> resources = getClass().getClassLoader() .getResources("META-INF/MANIFEST.MF"); //Can't find resource name META-INF/MANIFEST.MF ?...

Eclipse error using Maven filtering in persistence.xml

maven,jar,persistence,filtering
I have a Maven project with JPA using hibernate. I had to specify a jar file to load external classes in persistence.xml located in src/main/resources/META-INF <persistence unit name="PersistenceUnit" transaction-type="JTA" ... <jar-file>lib/${project.persistencejar}.jar</jar-file> using Maven filtering (the filename can change based on various Maven settings). I instruct then Maven to filter by...

How to deploy public-project Maven artifacts to a different remote repository?

maven
I am on a team making local changes to a public open-source code project with the following general structure: <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>7</version> </parent> <groupId>edu.cmu.sphinx</groupId> <artifactId>sphinx4-parent</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>sphinx4-core</module>...

is it possible to filter artifacts in Maven-release-plugin?

maven,maven-release-plugin
Is it possible to exclude some artifacts during release:prepare or release:perform? We don't need all the artifacts put on nexus, only two main ones.

spring.xml not packaged in executable jar

java,spring,maven,executable-jar
I created a simple java application using maven, spring and used log4j for logging. Following are the files. public class TestCrawler { public static final String SPRING_CONFIGURATION_FILE = "spring.xml"; private static final String INITIAL_URL = "http://yahoo.com/"; private static final String SPIDER_BEAN = "spider"; public static void main(String[] args) { System.out.println();...

Grails 3.0 Searchable plugin

maven,grails
I've tried to use the searchable plugin in grails 3.0, but I am not sure wheather it is compatible or not. I've added compile "org.grails.plugins:searchable" to the dependencies. The build completes but yields a NotSearializableException: > Configuring > 1/1 projects > Resolving dependencies ':agent' > Resolving dependencies ': BUILD SUCCESSFUL...

Force execution of a Maven phase

java,maven
I have a Maven POM with pre-integration-test and post-integration-test phases as follows. <execution> <id>start-server</id> <phase>pre-integration-test</phase> <goals> <goal>start-server</goal> </goals> <configuration> </configuration> </execution> <execution> <id>stop-running-server</id> <phase>post-integration-test</phase> <goals> <goal>stop-server</goal> </goals> <configuration>...

Maven local artifactory file edit

java,maven,artifactory
I have uploaded some of the jars to the my local artifactory... For a example.... Repository Browser +--org |-jboos |-json |json-java |-maven-metadata.xml This xml file Dependency Declaration shown as below <dependency> <groupId>org</groupId> <artifactId>json</artifactId> <version>json-java</version> <type>xml</type> </dependency> I need to change this xml file for a reason. Is there anyway to...

Can I have partial maven workspace resolution in eclipse?

java,eclipse,maven,m2eclipse
I have 3 projects - A, B and C. A has dependencies on B and C, and I deploy A to Tomcat in eclipse. I want A to deploy with the workspace versions of A and B. I don't want my workspace copy of project C to be picked up...

Redirecting the nexus-staging-maven-plugin to an internal repository

maven
I have a webjars project that I'd like to build snapshots and have them deployed locally (within our infrastructure) but have the releases be managed by webjars.org. https://github.com/webjars/oscar/blob/15.0.0-RC1/pom.xml The problem I'm facing is that they need the nexus-staging-maven-plugin defined as part of their release process. So I'd like to keep...

How to specify google play services dependency in maven

android,maven,google-play-services
I build a project with maven, I want to add a dependency to Google play services wear. My Gradle build file has compile 'com.google.android.gms:play-services-wearable:+' and in my pom.xml under "dependencies" I put <dependency> <groupId>com.google.android.gms</groupId> <artifactId>google-play-services</artifactId> <version>5</version> <type>aar</type> </dependency> but maven keeps complaining "Could not find artifact". How do I specify...

sonar maven analysis only picks .java file

maven,groovy,sonarqube,sonarqube-5.0
I am trying to run a sonar maven analysis on my multilanguage project which contains many languages like *.java, *.groovy, *.js etc. I have installed all the languages plugin in my sonar and configured my pom sonar.sources parameter as src/main,src/test but still it picks up only java files. In the...

The method is undefined for the type [Class Name]

java,maven,dependencies,maven-plugin
I have to projects both contains the pom.xml , Let say Project A and Project B. In project B I added project A as dependency in its pom.xml. In project A there is a class Mirror.java, in this class I added method and then updated the Project B by right...

Trying to use Java Message Service (JMS) API with Service Bus and AMQP

java,maven,azure,amqp
I'm trying to execute this example program, but I am getting the following class not found exception: javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory] at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at...

How to use a local tomcat version with maven

java,maven,tomcat
This may have been asked before (if it is please link me), but when I search I'm finding a bunch of how to run maven on tomcat, how to hook up an IDE to do this (nearly all of them are ide / configuration questions), how to use maven plugin...

spring-boot integration testing using rest-assured

maven,spring-boot,h2
I have been struggling with the issue of starting the H2 db in my tests. This is how the tests are annotated - @SpringApplicationConfiguration(classes = ServiceApplication.class) @WebAppConfiguration @IntegrationTest("server.port:8084") @PropertySource("test:application.properties") public class testSerivce{ //test scenario } The in memory db H2 is used and this is how its setup in application...

Android: Couldn't find GA library on maven

java,android,maven,google-analytics
I am trying to add a library dependency from my Android Studio for below: 'com.google.android.gms:play-services-analytics:7.5.0' However, I couldn't find the package.I even searched for it on search.maven.org but couldn't find it.However in the google docs it is mentioned :developers.google.com/android/guides/setup Can someone point the mistake I am doing?Meanwhile I acheived my...

Eclipse Kepler is unable to set the Java jdk 1.8 when maven project is updated

java,maven,java-8,eclipse-kepler
Installed java version is 1.8, while selecting this version in pom.xml and updating the maven project,it automatically jumps from 1.8 to 1.4, due to which I am unable to have Lambda expression specific code. I am using eclipse kepler. Any idea what is happening here ?...

Logging with log4j2 in Spring Boot app

java,spring,maven,logging,log4j2
I am trying to learn Spring Boot. But I completely mess up with a loggers dependencies. I have a simple pom: <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <!-- Logging --> <dependency>...

Maven multi-project depths

maven
I was trying to build Maven pom in something similar to the following hierarchical form: root    +-- A-POM       +-- B-POM       +-- C-POM            +---D-POM I was hoping that this could take care of my changed module problem. That is, if C is changed, then A must be rebuilt, etc. But I...

Java - Check properties file at compile time

java,maven,ant,properties
I need some advices from you today. I am working on a project which uses a huge constants holding class. There are lots of public static final String CONST_NAME = "const_value"; I am getting those using MyConstClass.CONST_NAME but now I need to externalise them in order to configure the project....

Idea 14 - Maven 3 - pass parameters

java,maven,tomcat,intellij-idea
I am looking for most efficient way to pass parameters to maven through idea 14 (I have just started working with idea). When I want to compile and deploy my application through maven itself, I just run this command mvn clean package tomcat7:redeploy -P localhost -Daugage_env=local. I dont know, how...

Maven GroupID and ArtifactID for J2EE Utility Project

java,eclipse,maven,java-ee,naming-conventions
I have a collection of 3 existing Eclipse projects that I want to make into Maven projects and I'm having a hard time understanding the relationship between the GroupID, ArtifactID and my Java Packaging, and the different directory structure that is created for Maven vs. Java projects. I'm pretty new...

Missing artifact error while adding a depentency in pom

java,maven
Am trying to add a dependency sauce-connect-plugin in to pom.xml file <groupId>com.saucelabs.maven.plugin</groupId> <artifactId>sauce-connect-plugin</artifactId> <version>2.1.18</version> </dependency> But building the pom file am getting Missing artifact com.saucelabs:sauce-connect:jar:3.1.32 Also i mentioned the repository <repositories> <repository> <id>saucelabs-repository</id> <url>https://repository-saucelabs.forge.cloudbees.com/release</url>...

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>...

deploying ejb-module for ObjectDB fails: PersistenceProvider not found

java,maven,ejb,wildfly,objectdb
I have two almost identical projects (both created with maven, both very simple) where one deploys without any problems, the other gives me a PersistenceException: javax.persistence.PersistenceException: JBAS011466: PersistenceProvider 'com.objectdb.jpa.Provider' not found And I just don't see what I am missing here. The working project is web application. I got it...

Maven: copy zipped resource subdirectories into target folder

java,maven,zip
I have a project with the following resources: resources - directory1 - directory2 I would like these to end up in the target folder as follows: target - resources - directory1 - directory2.zip I know how to use the maven-resources-plugin to copy the raw resources of directory1 and exclude the...

Is it mandatory to specify maven-failsafe-plugin to run integration tests?

maven,maven-plugin,maven-failsafe-plugin
Sorry about this very basic questions about maven-failsafe-plugin but I am not very much familiar with maven. Is it mandatory to specify maven-failsafe-plugin to run integration tests? Why can't mvn verify execute integration tests just like mvn test executes unit tests? Can integration tests be executed without this plugin? ...

Unable to load servlet listener class: com.sun.faces.config.ConfigureListener

maven,jsf,tomee
I'm using apache-tomee-jaxrs-1.7.1 and I'm trying to deploy with maven 3 getting this error: Unable to load servlet listener class: com.sun.faces.config.ConfigureListener: These are my dependencies in pom.xml: ... <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp.jstl</groupId>...

When adding dependency: CDI deployment failure, Unsatisfied dependencies for type Set with qualifiers @Default

maven,twitter,glassfish,twitter4j,twitter-hbc
When I add the twitter hbc dependency to my pom.xml I'm getting an error. I followed the instructions from here. I don't get it, if it was a dependency problem I should have found a fix on the web but if I comment out that dependency, my server is starting.....

can a class in a jar use a class in a different jar

java,eclipse,maven,jar
I am new to java so not sure I fully understand jar files. I want to put some common code in a library jar, which I then use from applications that are in different jars. I have searched on this but only come up with people saying yes and then...

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>...

Cannot import correctly maven properties with PropertiesFactoryBean and PropertyPlaceholderConfigurer in spring

spring,maven,datasource,placeholder,jrebel
I'm facing problems with a jdbc dynamic properties configurer. I try to explain what exactly the problem is. When I do mvn clean install and right after I deploy the applications in my server (Weblogic 10.3.3), everything is correct, and all the applications work fine. But, every morning, when I...

JUnit Tests: Why is Maven (Surefire) so much slower than running on Eclipse?

java,maven,unit-testing,junit,spring-test
I'm working on a fairly big application, with ~260k LOC and roughly 1800 unit tests on the suite. A little background: Multi-modular Maven project All tests run on a separate module and JaCoCo is used to check coverage. Tests are put together in some suites and then the suites are...

The type javax.servlet.ServletContext and javax.servlet.ServletException cannot be resolved

java,maven,servlets,spring-security
I'm trying to include Spring Security to my web project, i'm following this tutorial http://docs.spring.io/spring-security/site/docs/current/guides/html5//helloworld.html I've done everything in the tutorial with the given maven project and works fine. But when i'm trying to include it to my project a compilation error appear. Specifically when i extends from AbstractSecurityWebApplicationInitializer appear...

spring mvc and tile integration error

java,maven,spring-mvc,tiles
I got an error message when running the tile and spring MVC integrated project. I use spring 3.1.1 and tile 2.2.2.i appreciate your valuable answers error is as follows : java.lang.NoClassDefFoundError: org/apache/tiles/startup/BasicTilesInitializer at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2904) at...

'The command line is too long' when linking .obj files in Windows command prompt

windows,maven,dll,cmd,linker
As a last step to my maven build on Windows, it tries to create a dll file by linking around 1500 object files. Looks something like this: cl.exe foo.dll (around 1500 .obj files) (couple of other statically linked libraries) The build fails with just one statement: The command line is...

maven-war-plugin include subdirectories

java,maven,maven-war-plugin
I'm having an issue where I need to include some folders in my Maven generated WAR using the maven-war-plugin but it is only including the files in the directory and not the sub-directories as well. This is how I have configured the war-plugin within the pom. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration>...

javax.persistence.Persistence.getPersistenceUtil()Ljavax/persistence/PersistenceUtil

java,spring,hibernate,maven,jpa
In a Spring-MVC application I try to use the validators. I put the annotation @NotEmpty and @Email on one of my entity and when I try to validate it I get this error: java.lang.NoSuchMethodError: javax.persistence.Persistence.getPersistenceUtil()Ljavax/persistence/PersistenceUtil; at org.hibernate.validator.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:33) at org.hibernate.validator.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:112) at...

Trying to access Oracle's Maven repository

oracle,maven,repository
I'm attempting to access Oracle's repository. Oracle doesn't make it easy. However, I'm attempting to follow the documentation that Oracle provided. I've: Approved the licensing agreement on my system (in case there's some sort of cookie that needs to be set). Set both M2_HOME and MAVEN_HOME to /usr/share/apache-maven. Created an...

exec-maven-plugin error, even on working example

java,eclipse,maven
EDIT5 Updated / I'm using Maven 3.3.3. I just create new project and added compile and exec plugin, as examples on web. I tried to execute, but I got error [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project QNAProject: An exception occured while executing the Java class. com.jadex.qna.QNAProject.App ->...

How to filter attached sources using maven?

java,maven,maven-plugin,sources
There is Apache Maven Source Plugin, that creates a jar archive of source files. It's good, but what if I want to filter source files, and add to jar some of them (for example, marked with annotation or smth else). Is there some maven plugin or tool, that can do...

How do I set up a TeamCity build job to execute a maven job with no pom

maven,teamcity
We have an in-house developed MOJO that generates content and doesn't require you to have an existing project or POM. Think of the maven archetype plugin, where you can just run mvn [mojo]:[goal] and have maven just execute that goal without a POM. This MOJO connects to a specific database...

Use alternative producers of EntityManager / EMF in integration tests

java,maven,jpa,integration-testing,cdi
I looking for way how to use CDI and alternative producers in integration tests. When i speak about producers, i mean EMF producer. Reason for different EMF producer is that i want to use testing in-memory database (different persistence unit). Is there easy way how to start CDI for integrations...

How to add multiple jars under one dependency in jfrog Atrifactory

maven,artifactory
I have two dependent files, in one dependency like below: <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>3.0.7.RELEASE</version> </dependency> But when mvn install from Maven repository I'm getting two files "spring-context-3.0.7.RELEASE.jar & spring-context-support-3.0.7.RELEASE" Same thing how to upload to Atrifactory? I'm using artifactory-3.8.0 version....

How to configure user bundles so that they can be autostarted with higher priority - hence earlier than others?

java,maven,osgi,equinox
I need to run certain plugins before others. First thought was to add names of bundles, priorities in '\configuration\bundles.info' but on start of OSGI it was throwing error java.lang.Exception: Could not find plugin com.example.myplugin. The added line was similar to this: com.example.myplugin,1.1.1,dropins/MY-ARTIFACT-1.2.3-SNAPSHOT/eclipse/plugins/com.example.myplugin-1.1.0.SNAPSHOT.jar,2,true Then I added to \configuration\config.ini the parameter: osgi.bundles=reference\:file\[email protected]\:start...

IntelliJ - use imported modules as dependencies like maven projects in Eclipse

eclipse,scala,maven,intellij-idea,sbt
I've been asking myself this question for a couple of years but never really found the solution. I used to work with eclipse (on maven java projects). I could import a project -let's call it 'proj-A'- and if one of proj-A's dependencies was found in the workspace with the same...

SonarQube 5.1 Adding Custom Rule for java

java,maven,sonarqube,sonarqube-5.0
I have implemented Sonar Java Plug-in(Maven) following the example here : https://github.com/SonarSource/sonar-examples/tree/master/plugins/java-custom-rules. Copied the generated sonar-plugin in /extensions/plugins directory. Restarted the SonarQube server and ran the analysis using the mvn sonar:sonar. I can see the new Rules being added in Rules tab but no issues are being logged and also...

Spring MVC point to host name

java,maven,spring-mvc,tomcat8
I'm setting up a Spring MVC project for my own knowledge and I'm hitting a bit of a bump. I have a welcome file and a web service set up and they work pretty nicely. However, instead of localhost:8080/ZFGC/ hitting the welcome file, I'd like localhost:8080/ to hit it. From...

Gradle: Adding sources.jar file within /lib folder of published dist.zip along with all my other dependencies

java,maven,jar,gradle
I have a java project that I am building using gradle. I am releasing a dist.zip folder for my project and I want to add the sources.jar for my project to the /lib subfolder within dist.zip. I am able to create a sources.jar file along with my dist.zip file but...

Maven Nested Modules - Second Level Children

maven,directory-structure,multi-module
I read a lot about maven multi module projects and came to the conclusion that I want to use the following approach: root --pom.xml --parent --pom.xml --module-a --pom.xml --module-b --pom.xml see here But now I am a bit struggling on how to handle second/third/n level modules, e.g. module-a has also...

Failed to execute goal on project. Unable to find POM in project

java,maven,jboss
I am trying to build an application having following dependency. <properties> <version.jboss.as>7.5.0.Final-redhat-21</version.jboss.as> </properties> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-jms-client-bom</artifactId> <version>${version.jboss.as}</version> <type>pom</type> </dependency> </dependencies> This is an example which i found on Red Hat Site -...

POM errors using manually downloaded dependencies

java,maven,pom.xml
I'm working on a web-app that a group started a while ago, but I can't make it run. I'm quite a newbie with STS (Spring Tool Suite) and Java, and I installed all the dependencies manually with .jar files. But now my pom.xml is showing many errors. I guess there's...

How to make dependency transitive in Gradle

maven,javamail,android-gradle,build.gradle,gmail-api
I have downloaded javax.mail-api-1.5.3.jar file copied into app/libs folder and then right click , add as library. Then following line appears under dependency compile files('libs/javax.mail-api-1.5.3.jar') I want to make this dependency transitive.Because I have mention javax.mail-api library dependencies in pom.xml file like follows. <dependencies> <dependency> <groupId>javax.mail</groupId> <artifactId>javax.mail-api</artifactId> <version>1.5.3</version> <scope>test</scope>...

how to manage multiple war application in tomcat server?

java,maven,tomcat,servlets
I use tomcat as web server,I want to deploy many same war file in tomcat server with different config. How to do this in the best way possible manner? So I want to run tomcat server per each war application, my means is tomcat1 handle the .war1 in webapp and...

Dyanamic web module 3.0 required java 1.6 or newer

java,maven,spring-mvc
In my project i got following error in Markers. I also set java 1.6 in project facets ,java compliler and buildpath but not solve this error. ...

How to access jenkins parent job build id in a MultiJob?

maven,jenkins
I have a requirement to trigger Automation Suite in multiple phases and summarize test results in a single test summary report. I configured a Jenkins Multi Job to trigger my automation suite, which is divided in to multiple chunks say suite#1, suite#2, suite#3, suite#4 (each suite is a maven job)...

Maven build profiles in a mutli-module project property expansion

java,maven,properties-file
I have a Multi-Module Maven project. My parent POM has the following modules: <module>common</module> <module>ingest</module> <module>package</module> The package modules handles all aspects of building a deployable zip file using maven-antrun-plugin. The other two modules are where the core application code is located. Within the package I have various profiles holding...

Unable to download com.thoughtworks.paranamer#paranamer;2.5.6 with sbt

maven,sbt
I'm getting the following error when building my project: [warn] problem while downloading module descriptor: https://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.5.6/paranamer-2.5.6.pom: invalid sha1: expected=534448ad3c4af760c8995370c1405b9dbf88609e computed=0d33f7748ec6c8928db74f9652a2cb7567fe4044 (116ms) [warn] module not found: com.thoughtworks.paranamer#paranamer;2.5.6 This is a transitive dependency, which I was able to download previously. I got this error when I wiped my ~/.ivy2/cache dir. Not really...

Include ftl file in ext plugin

maven,liferay,liferay-6
I have ext-plugin and I would like to override this file: portal-impl\src\com\liferay\portlet\dynamicdatamapping\dependencies\ddm\documentlibrary.ftl. After maven build, this file isn't include in my porta-impl-ext.jar. In my portal-impl-ext's pom.xml I have this code: <build> <plugins> <plugin> <groupId>com.liferay.maven.plugins</groupId> <artifactId>liferay-maven-plugin</artifactId> <version>${liferay.maven.plugin.version}</version> <configuration>...

building api only artifact with maven

java,maven,dependencies,modularity
Given our maven projet provides some api for clients to interact with it, those are just few java interfaces which are implemented in interal codebase... Now if we just build the jar and publish it anyone can see the internal classes we used for implementation, yet we only need few...

Eclipse OSGI unsatisfied constraint

java,eclipse,maven,osgi
I have a basic OSGI project in Eclipse. When I created a class Activator and imported the BundleActivator, Eclipse changed the MANIFEST.MF adding these lines: Export-Package: my.package.name;uses:="org.osgi.framework";version="0.0.1.SNAPSHOT" Import-Package: org.osgi.framework;version="[1.8,2)" Now Eclipse ("problems view") prompts this error message: Unsatisfied constraint: 'Import-Package: org.osgi.framework; version="[1.8.0,2.0.0)"' Plug-in Problem MANIFEST.MF I have imported the newest...

Where is the source code for maven-properties-plugin?

maven,properties
The maven-properties-plugin sources used to be hosted on Codehaus (http://mojo.codehaus.org/properties-maven-plugin), but I cannot find the new home for the sources anywhere. Does anyone know if they have been migrated somewhere? I checked the CodeHaus' github repo, but can't find them there. The last known version was 1.0-alpha2....

Maven Parent Project classes not accessible

java,eclipse,maven
I have a maven projects, parent and a child project Parent pom file <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.xx</groupId> <artifactId>parent</artifactId> <version>15</version> </parent> <artifactId>remote</artifactId> <version>2.0.0.0-SNAPSHOT</version> <dependencies> ...</dependencies> <build> <plugins> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration>...

Exclude classes of jar files from jacoco coverage report

java,maven,jacoco
Jacoco code coverage report is also including classes from "system path jar" that I have added using below maven dependency <dependency> <groupId>axis</groupId> <artifactId>axis</artifactId> <version>1.2.1</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/resources/lib/axis-1.2.1.jar</systemPath> </dependency> I tried to exclude the files of this jar from jacoco plugin like this : <plugin> <groupId>org.jacoco</groupId>...

Deploy closed source aar maven repo to github

android,git,maven,github,gradle
I am using the following guide to publish a closed source aar as maven repo on github: http://andydyer.org/blog/2014/10/05/hosting-android-dependencies-on-github/ The github repo I am publishing to: https://github.com/tabishfayyaz/test-sdk In my gradle.build file I have: repositories { maven { url "https://github.com/tabishfayyaz/test-sdk/blob/master" } } dependencies { compile 'com.adscendmedia.sdk:adscendmedia:1.0.1' } However Android studio results in...

Spring XML cannot find my Spring Java Configuration Class

java,spring,maven
So I have been using the 3.2.0.RELEASE Spring XML configurations for most of my beans but now I am faced with a unique situation where the Getters and Setters can't be used (bad legacy code - can't get around it). As such, I want to use Spring @Configuration class and...

How do you create a custom project type (from my plugin) without opening Eclipse?

java,eclipse,maven,eclipse-plugin
I have created a plugin for Eclipse. With the help of this plugin, I am creating a new type of project, let's say XTypeProject. The creation of this XTypeProject is similar to any other type of project you create in Eclipse. File -> New -> YourProjectType I just want to...

maven dependency management from parent pom overrides ${project.version}

java,maven
I have a parent pom with a dependency management like this: <dependencyManagement> <dependencies> <dependency> <groupId>com.group.id</groupId> <artifactId>art1</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>com.group.id</groupId> <artifactId>art1</artifactId> <version>1.0</version> </dependency> </dependencyManagement> The artifacts art1 and art2 are submodules from the same module and they...

Spring framework unable to start embedded container

java,spring,maven,spring-mvc,spring-boot
I'm following Spring in Action 4th Edition Chapter 5, but I'm stuck at the very first example. Here is my Eclipse Luna project structure: If I run this project as Spring Boot App, then it throws exceptions: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start...

Different ways to override java version especified in parent pom

java,maven,pom.xml
I´m using a parent pom which establishes java version to 1.5. In my concrete project I use 1.6 so I was changing the compiler version in eclipse each time I did a Maven Update. Looking for a solution to this I found some solutions involving overriding the behavior of the...

Selenium Simple Chrome WebDriver: java compilation and execution problems

java,maven,selenium,junit
I'm new to Selenium and I have little knowledge of the java compilation and run process, because I always compiled and executed with the help of the IDE. My problem I'm trying to run a simple test with selenium (for learning purposes) to request "www.google.com" and assert that the title...

Liquibase 3.3.3 refusing to run “due to maven configuration”

maven,liquibase
Did something change in liquibase between version 2 and version 3? I have the following in my pom file... <plugin> <groupId>org.liquibase</groupId> <artifactId>liquibase-maven-plugin</artifactId> <version>3.3.3</version> <configuration> <changeLogFile>src/main/resources/liquibase/liquibase-changesets.xml</changeLogFile> <driver>${db.liquibase.driver}</driver> <username>${db.liquibase.username}</username>...

Sync jboss modules and jbossdatahome between devs

java,maven,jboss,jboss7.x,jboss-arquillian
We're using local jboss 7 instances (maven jboss plugin) with custom modules for local development. Each dev can work on multiple projects. For each project, each dev needs to have the proper jboss modules and jbossdatahome folder. Each dev needs the same path to these folders, as they are hard...

Clojure interop with Java: how to call a class?

java,maven,clojure,interop,leiningen
I have a Java app that has a class at this address, inside a standard Maven layout: src/main/java/com/ollio/nlp/Transformer.java The class and method that I want looks like this: package com.ollio.nlp; public class Transformer { public String transform(String JSONInput) { I store the jar artifact locally in my Clojure app at...

Maven project with multiple module and multiple assembly

java,maven,maven-assembly-plugin,multi-module
I'm having difficulties trying to construct a maven project with multiple module and each module has its own assembly. I'm not too sure if this can be done in maven or not in the first place. I have a project structure like so: project +- root | +- pom.xml +-...

Maven error with Java 8

java,maven,java-8
Getting an error with Maven and Java 8 (jdk1.8.0_45). This issue does not occur with Java 7. MCVE Create a sample maven project. For example: mvn archetype:create -DgroupId=testinovke -DartifactId=testinvoke Create the following content in the generated App.java file package testinovke; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; public class App {...

How to create zip file with maven: Java Client + JRE

java,maven,zip,client
I want to package a java client together with a runtime into one Zip-file. How should I do this with maven? Java Client: package com.test.client; public class Client { public static void main(String[] args) { System.out.println("Hello world!"); } } This runs like: java -cp "client.jar" com.test.Client I want to deliver...

SBT PublishM2 do not refresh snapshot jar in local maven repo

scala,maven,sbt
I have a simple Sbt project name := "xxxx" organization := "xxxxx" version := "0.0.2-SNAPSHOT" scalaVersion := "2.11.6" resolvers += "spray repo" at "http://repo.spray.io" scalacOptions in ThisBuild ++= Seq("-language:postfixOps", "-feature") libraryDependencies ++= Seq("io.spray" %% "spray-client" % "1.3.3", "io.spray" %% "spray-json" % "1.3.2", "com.typesafe.akka" %% "akka-actor" % "2.3.11", "org.dspace" % "dspace-api"...

HTTP Status 500 - java.lang.LinkageError - Servlets

java,jsp,maven,servlets,web.xml
I'm trying to configure a simple page with JSP and getting an error. My web.xml is: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>ERPWep-calendar</display-name> <servlet> <servlet-name>calendar</servlet-name>...

Receiving a NoClassDefFoundError even though jar is successfully downloaded via Maven and referenced in pom.xml

xml,eclipse,spring,maven,dependency-injection
Runtime exception I am receiving is: Caused by: java.lang.NoClassDefFoundError: org/springframework/core/io/Resource Even though there are no errors within my project and I've updated via 'Maven update' and running 'Maven clean install' builds successfully. The dependency in my pom.xml is: <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.1.4.RELEASE</version> <scope>compile</scope> </dependency> Have also tried with scope set...

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...

how to generate a checksum for a war file in maven

java,maven,war
I have inherited a project which uses a maven pom file to build the .war file and we have a request to generate a checksum of the .war file, so my question is, can this be done in the maven pom file? and what plugin if any is needed and...

Compilation Error on maven

java,eclipse,maven,maven-plugin
Working on maven project. I m trying to build using maven but I m getting the following error! I m working on eclipse using JDK 8. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) I also tried the above solution, but still I m getting error! [INFO] Scanning for projects... [INFO] [INFO]...