Questions tagged [maven]

33161 questions
1

votes
2

answer
3.4k

Views

How to resolve java.lang.NoSuchMethodError [duplicate]

This question already has an answer here: How do I fix a NoSuchMethodError? 27 answers I have a project that I can run correctly from within Eclipse, but running the standalone jar gives me the java.lang.NoSuchMethodError for a class at runtime. I unpacked the jar file and can see the class file i...
user2777473
1

votes
1

answer
177

Views

Maven surefire environmentVariables doesn't work on one machine

Background: we are setting current project version as system environment: org.apache.maven.plugins maven-surefire-plugin 2.19.1 always ${project.build.outputDirectory} ${project.version} And then we get the value in the test using System.getenv('project.version'); and this works just fine on all mac...
Wojtek
0

votes
0

answer
4

Views

Spark-Scala Log Rotation Issue, Unable to create External Log

Spark-Scala Log Rotation Issue, Unable to create External Log : Unable to create log rotation using RollingFileAppender & ConsoleAppender: i have received below WARN during execution, unable to create any log file in following location. Still using default log file. ++++++++++++++++++++++++++++++++...
Srini K
1

votes
0

answer
10

Views

Can I somehow run multiple web modules that share the same library module with one SpringBootApplication?

I'm starting a Spring project that should be consisted of four main modules: Core module - has service and repository layer (should represent a common library for other modules) Admin module - should contain its own security configuration and endpoints (Controllers) Customer module - should contain...
K. Stef
1

votes
2

answer
510

Views

Running “mvn clean install” maven command using ansible module

I am trying to implement the CI/CD pipeline for my project. I am using Ansible , Docker and jenkins. SVN checkout , Image docker image building , image pushing to Dockerhub , Pulling and deploying etc every stages are planning to do using ansible roles.Now I successfully implemented sample svnchecko...
Jacob
1

votes
2

answer
5.4k

Views

Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code

I am trying to run a Jmeter test on remote machine ( macOS sierraO). I configured [email protected] - Chrome Driver Config and I can connect to the slave machine. However, whenever I try to run it I get Starting ChromeDriver 73.0.3683.20 (XXXXXXX) on port XXXX Only local connections are allowed. Please protect...
AwadOdeh
1

votes
3

answer
80

Views

How to upgrade groovy-all from 2.4 to 2.5 when running in OSGi?

I'm maintaining an open source library based partly on Groovy called Rest Assured. In the next version I'd like to upgrade the Groovy dependency from 2.4.x to 2.5.x. However when doing this I run into issues when running the OSGi tests. The tests are using Pax Exam they typically look something like...
Johan
1

votes
1

answer
41

Views

Download artifacts from Maven repository without using Maven

In various shell scripts, we need to download artifacts from a Maven repository (Nexus 2.x at the moment, but may change in the future). The servers that run the scripts usually have no Maven installed. So I am looking for something http based. On the one hand, there is a REST interface which can be...
JF Meier
1

votes
2

answer
49

Views

maven is not downloading any dependency that I have add

I have install maven and JDK and tried to create maven project and add some dependencies, as you can see in the screenshot but the dependency is not downloading so I can not import. can you help.
Khalid AL Bitar
1

votes
1

answer
26

Views

Gradle generate sources.jar for only public interfaces

I am working on a closed-source Android library (published as an AAR), and want to include some javadocs for consumers, which requires a sources.jar. I know I could cherry-pick each file using an includes property or maybe even a whole package/folder. task('androidSourcesJar', type: Jar) { classifie...
MikeB
1

votes
2

answer
28

Views

maven-jar-plugin does not include .gitignore file

I try to package an application into a jar file with maven. Somehow all files except .gitignore files are added to the jar. Why is this file skipped and how can I disable this? Even if I try to include it like below the include is ignored and the jar file remains empty. org.apache.maven.plugins mave...
ochs.tobi
0

votes
0

answer
3

Views

Can I have two persistence.xml files in my spring maven project

Is it possible for me to have two different persistence.xml files under META-INF eg. persistence-one.xml and persistence-two.xml and then somehow use in my spring-context.xml to use the appropriate one using property files ? I am doing this because I have two separate environments with different...
Neeraj Chand
-1

votes
0

answer
13

Views

can i pass parameters while i´m deploying and then read it? mvn appengine:deploy -Ddatabase_intance=mydatabase

i´m deploying in Google App Engine i´m trying to pass a param when mvn appengine:deploy -Ddatabase_intance=mydatabase and then in the application.properties i´m trying to read it database=${database_intance} i think that there is no way to do this easily, but if someone could help me to see clear...
Jeronimo Alderete
5

votes
4

answer
123

Views

How to exclude error prone from being run on unit tests?

When maven-compiler-plugin:3.8.0:testCompile @ foo-child runs, thread dumps show errorprone is taking an extremely long time. I believe there is a bug with errorprone, but for now I'd rather just have errorprone not run on unit tests. I have a parent pom.xml: foo-child com.google.errorprone error_pr...
lf215
0

votes
0

answer
4

Views

Required projects on eclipse keep disappearing after maven clean build

I have a pom as follows. 4.0.0 com.kt.web KT-web 1.0 ktweb Web App org.springframework.boot spring-boot-starter-parent 1.5.9.RELEASE UTF-8 UTF-8 1.8 1.2 2.2.2 4.0.4.RELEASE ... ... org.springframework.boot spring-boot-maven-plugin kt-web com.kts.common kt-common 1.0 Whenever I run maven clean instal...
user826323
1

votes
1

answer
2.8k

Views

Detect OS and Java on Windows and Linux

I have a JavaFX project based on Maven. I want to build the Maven project on Windows and on Linux. In order to automate the process when I deploy the bundle I want to automatically detect the operating system. In windows I have this configuration: org.apache.maven.plugins maven-compiler-plugin 3.1 1...
Peter Penzov
0

votes
0

answer
17

Views

Is there any way to add a dependency to mvn `process-classes` phase?

The maven process-classes phase 'post-process the generated files from compilation, for example to do bytecode enhancement on Java classes'. What's the classpath of the maven 'process-classes' phase? In maven, it is possible to define the scope of each dependency. The scope can be compile, provided,...
josecampos
3

votes
0

answer
16

Views

How to build same source code twice with different dependency version, in both Maven and Eclipse?

I would like to build two different versions of a custom SonarQube (SQ) plugin; one for SonarQube 6.7.x LTS release, one for the latest 7.6 release. At the moment, I have a Maven structure similar to the following: parent common: Common code used by both tool and both plugin versions, doesn't use SQ...
rsenden
1

votes
1

answer
897

Views

Comparing OSGi vs maven? [closed]

OSGi allows to add/change dependencies aka bundle, when Maven allows to add/change dependencies aka jars. Then what the difference? It's like hitting the one goal by different ways
WildDev
0

votes
0

answer
11

Views

Maven project : IOException error when creating a Jar file

I try to create a jar file with a Maven project but when i run the jar file I have a IOException.Is there something to add to the pom.xml file? I use a Maven project because i have to add jfreechart dependency. Thanks you
Daniel xx
1

votes
1

answer
880

Views

How to dereference old Wildfly 9.0.1 deployment artifacts of Spring MVC app built with intelliJ-IDE?

I'm using intelliJ-IDE-14 to create a SpringMVC project named app which was initially being deployed to JBoss Wildfly 9.0.1.Final as app.war Here's the step by step scenario leading up to my issue; After finishing project config to utilize Maven | Spring | Hibernate | Wildfly | Velocity, then I made...
CodeBurner
-1

votes
1

answer
25

Views

netbeans vs eclipse project structure comparision

I use Netbeans and i am having the same problem while learning from project that is written in Eclipse. In Eclipse,why is there another folder 'Java Resources'? should not all the source files be in - src/main/java and resources files in -src/main/resources? Why use folder 'Java Resources' to write...
bron
1

votes
1

answer
1.2k

Views

How to package multi module in a zip file?

I have a multi module project. Each module is packaged in a jar/war file in his own /target folder. I want to take every module jar/war files and some config files, and put everything in a zip. How to do that? I try with assembly plugin, but all i've managed to do so far is a zip of each module in...
Lempkin
1

votes
3

answer
874

Views

NoSuchMethodError when trying to send email in Spring Boot

I am attempting to send a simple email message: @Autowired JavaMailSender sender; public void sendEMail() throws Exception { MimeMessage message = sender.createMimeMessage(); MimeMessageHelper helper = new MimeMessageHelper(message); helper.setTo('[email protected]'); helper.setText('How are you?'); hel...
Wilhelm Sorban
1

votes
1

answer
117

Views

Freshly cloned Tika build fails

I am trying to install Apache Tika on Windows and am running mvn install as per the instructions When I do so I get a failure as shown below: Tests run: 12, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Dave Poole
3

votes
3

answer
59

Views

How to execute ant jar from maven-antrun-plugin

We are using Maven in combination with an Ant build.xml file for our buids. The maven-antrun-plugin looks like this: org.apache.maven.plugins maven-antrun-plugin 1.8 Compile sources compile run The maven-antrun-plugin uses Ant 1.9.4 internally. Is there a way to replace the dependency to ${ant.exec}...
Lieven Cardoen
1

votes
2

answer
518

Views

mvn clean install results in surefire error

I have not made any changes to my projects, but they are all resulting in errors when I run mvn clean install or mvn package The projects run fine when I run them in Spring Tool Suit (Pretty much Eclipse) Below is from one of my projects [email protected]:~/Documents/workspace-spring-tool-suite/HelperAPI...
Arya
1

votes
2

answer
54

Views

ClassNotFoundException for commons-lang3 when deploying WAR to Wildfly 14

We're developing an application which uses: Wildfly 14 Java EE 7 The code compiles successfully and the WARs are packaged. However upon deploying the WARs into Wildfly I get the following exception: Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils from [Module \'depl...
Robert Strauch
1

votes
2

answer
42

Views

Maven - check configured value and stop processing

I have a POM file which includes a property (under properties section) which has an IP value that we use when pushing it to git. 1.2.3.4 But for my builds, I need to use a another IP value, so I should change it to my required IP when I start to work on a new branch. I'd like to be able to check th...
dushkin
1

votes
1

answer
101

Views

java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Row

I've made a small application that reads from an excel (xls file) and displays the contents to a JTable. Everything is working fine in eclipse, yet when I create the jar file and try to run it, I get the following issue: java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Row The weird thing...
colin
1

votes
1

answer
78

Views

Publish artifact to local maven repo with SBT and use it in Gradle project

Here is what I want to do: In my Scala sbt project, I want to publish an artifact to my local maven repository Afterwards, I want to use this artifact in a Gradle-based Java project Here is where I struggle: I have published the artifact somewhat successful using sbt publishM2. Here is my build.sbt:...
Florian Baierl
1

votes
2

answer
70

Views

Liquibase resource found in both Maven target and Maven repository

I have Eclipse Maven GWT project and I added flowable-form-engine dependency that uses Liquibase. Liquibase is searching for changelog file org/flowable/form/db/liquibase/flowable-form-db-changelog.xml but finds two! org.flowable.common.engine.api.FlowableException: Error initialising form data sch...
Piro
1

votes
1

answer
42

Views

Maven not running tests from command line

I am trying to run one project from cmd line using mvn test. It shows build success but not running any tests as it shows test runs:0. I have tried all the suggestions provided in stackoverflow but still its not running. Please let me know what i am missing here. My Maven Project: Command line Resul...
Jagadish Dabbiru
1

votes
2

answer
106

Views

How to continue execution after “NoSuchElementException” in Selenium (Java)?

I'm attempting to create an ArrayList of WebElements from this page: If all the elements are displayed, they're able to be added to the ArrayList just fine. ArrayList TodoArray = new ArrayList(); TodoArray.add(todo1); If I remove one of the elements from the web page(not code) I get this error when...
Few_Line
1

votes
1

answer
20

Views

How to run multiple cucumber runners from maven command line

I've 2 CI flows , which flow needs to run it's own cucumber runner RunnerATest RunnerBTest I'm using maven command line to run the tests (mvn test) Is there a way to select a specific Runner from command line ? Thanks
Igal
1

votes
1

answer
30

Views

Tomcat throws java.lang.IndexOutOfBoundsException

I am running a simple web project.In one of my servlet i get the user's parameters from the form and run getIf method of my UserDao class which returns all the users from the database that match some kind of a condition. Here is the code of the getIf code: @Override public synchronized List getIf(Us...
Barracuda
1

votes
0

answer
190

Views

Got error while migrating to Android Studio 3.1 Canary 5 Build?

I tried following steps: 1.changed to classpath 'com.android.tools.build:gradle:3.1.0-alpha05' maven { url 'https://maven.google.com/' name 'Google' } and added google() android.enableAapt2=false in gradle.properties 4. android { compileSdkVersion 27 buildToolsVersion '27.0.1' defaultConfig { appli...
Swapnil
1

votes
1

answer
307

Views

Eclipse : Can't import class from another project's test folder

I have two projects, lets call them A and B. B is a dependency in A's pom as my.group.id B 0.0.1-SNAPSHOT now i have some unit tests under src/test/java/ in project A. Here is a test class i have src/test/java/packA/testForA.java Also, in project B, I have src/test/java/packB/configForB.java I need...
AbtPst
1

votes
1

answer
571

Views

Kotlin (Maven) - executable JAR without source files

I wanted to create an executable kotlin jar file with maven. But somehow the kotlin source files are packed with the jar. I configured the kotlin plugin and the maven assembly plugin to create a self-contained jar. Here are the dependencies and plugins of my pom: . 1.8 1.8 1.2.0 0.20 server.RunKt ju...
mrdlink

View additional questions