Questions tagged [maven]
Apache Maven is a build automation and project management tool used primarily for Java projects. This tag is for questions that don't relate to a specific Maven version. Use the gradle tag instead for questions relating to Gradle.
78,894
questions
0
votes
0answers
3 views
Use custom SpotBugs plugin in multi-module maven project
I have create a custom SpotBugs plugin for maven like described here in a multi-module maven project. But I cannot figure out how to use it. There really is not much documentation or examples for this....
0
votes
0answers
4 views
retrieve dependencies from multiple enterprise repositories
There are two repositories in our company(say A,B). Our team uses repo A. I need to get a dependency from repo B for my Java build.
I tried the following.
Added an additional mirror in maven settings ...
-1
votes
0answers
6 views
Issue is installing STS
Multiple annotations found at this line:
- Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:testResources failed:
Unable to load the mojo 'testResources' (...
0
votes
0answers
10 views
Bad class file-wrong version error when using JAR but its maven configuration target is properly set
I have been trying to make a library work with our Android project. Currently, we are getting errors with the library during our lint check:
bad class file: .....
class file has wrong version 55.0,...
0
votes
0answers
16 views
Cannot access defaults field of Properties
I am having trouble deploying my application to tomcat. It was working before, but i formated my computer and it stopped working.
My pom.xml:
<project xmlns:xsi="http://www.w3.org/2001/...
0
votes
0answers
19 views
maven can not find y JDK even though im sure its pointing correctly to Mac OS. JAVA_HOME environment variable is not defined correctly
OK I know that this is probably a very common issue but im at my wits end. So I installed java 8 and I set my JAVA_HOME to point to I believe the correct destination. so on my Mac I run
which java
/...
0
votes
1answer
11 views
Why do I have a lot of error messages in my Controller since I upgraded Intellij IDEA ultimate from 2020.3 to 2021.1?
Just updated Intellij IDEA ultimate 2021.1 I work with Springboot, maven and Thymeleaf for my Java programs.
Since then my earlier projects show a massive red errors in the controller on every ...
0
votes
0answers
11 views
How do you pass arguments from Maven command line to Java program? [closed]
I need to pass a number from the command line into a java file. Right now, I am running mvn compile exec:exec to execute my project.
I know that I need to add something to pom.xml and I know that my ...
0
votes
1answer
15 views
Jacoco not considering coverage for all test classes
I have jacoco running for my build and I noticed if there's 2 test classes testing the same main class, coverage from one of the test classes is missing.
For example, I have a class MyApp. Now I have ...
0
votes
0answers
28 views
My program doesn't run thought it not give me errors
I'm beginner in Spring mvc, I created a webapp project in eclipse using maven , and it's configured with java pure code. There is no error in project but when I run it, it dosen't work and it give me ...
0
votes
0answers
8 views
providing cucumber test report name through maven command
In my pom.xml I have created different profile for smoke and regression test using cucumber framework. The using the below maven command to run the tests. Following is an example of smoke test:
mvn ...
-1
votes
0answers
13 views
Failed building a war file from spring boot app
we are having difficulty generating the war file from a spring boot application. We have tried several proposals, but the problem remains. could someone help us to solve this problem ?
E:..\java\jdk1....
0
votes
0answers
8 views
Run mvn liquibase:update from my jar file
I want to run the command mvn liquibase updatethrough my jar file, but the migrations aren't being executed.
//argument provided is run
if (args[0].equals("run")) {
...
0
votes
1answer
14 views
How to add a goal to release:perform phase of maven-release-plugin
I use the swagger-maven-plugin from kongchen. Additionally I use the maven-release-plugin. The swagger.json which is generated from swagger-maven-plugin is not part of the repo. If I build the ...
0
votes
0answers
26 views
Downgrading Spring Boot App from Java 11 to Java 8
I've written the spring boot app, basically REST services using: Maven project with Spring boot, spring data Jpa, Spring web, Java version 11. java.version is written in pom.xml. I am also using ...
0
votes
0answers
17 views
Java .print is hanging when followed by scanner
My code is below. If I switch .print to .println, everything works fine except the input request happens on the line below rather than after "Enter the table size: ". When I keep it as ....
0
votes
1answer
11 views
Class<SpringExtension> cannot be resolved
I am trying to migrate a JUnit 4 test to JUnit 5. Eclipse does not recognize SpringExtension.class : Class cannot be resolved. I use Spring 5.2.2 and Maven in the project.
How can I resolve this error?...
0
votes
0answers
14 views
Not able to fetch password provided in POM.xml plugin configuration
I have written a java class script file in my project. I have provided the necessary configurations in POM.xml. I am using this provided password and username in my java class using context method of ...
0
votes
0answers
14 views
Azure Java App Service Deploiement error with multi-module project only
I'm trying to deploy my multi-module Java Spring Boot application with Github to Azure but I'm encountering an error on the deploy phase. My project has 1 .war module to deploy and 1 .jar library used ...
0
votes
0answers
8 views
how to run patch builds using maven?
I have a multilevel projects and i have some modules which needs to be build and not the entire pom . How can i achieve the same.
<module>app/push</module>
<module>app/...
0
votes
1answer
19 views
spring-boot: inside jar file and how is it executed
I am currently developing the spring boot application with maven and eclipse.
-when I build the app, txt file under resources folder will be included in jar file?
and can I exclude it from jar?
-when ...
0
votes
0answers
8 views
Error while downloading 'http://www.ryantenney.com/schema/metrics/metrics.xsd' to C:\Users…\schema\metrics\metrics.xsd
Got this Marker when compile the maven project.
It's great if anyone could help me to figure out.
Thanks.
-1
votes
0answers
24 views
Increasing xmx does not resolve the java.lang.out of memory error [closed]
I am getting java.lang.OutOfMemoryError: Java heap space error in intelij when run mvn. increasing xmx value to 6GB did not help. I do not think 6GB is not enough for this task. please help.
0
votes
0answers
22 views
Can not execute PUT and DELETE method in Heroku
I made an REST app by using spring-boot and deployed to Heroku.
The following method in this app are mapped http methods respectively.
They can be executed in local.
user
Registration(POST) → can ...
0
votes
0answers
14 views
Maven archetype + Velocity: how to show the current directory and delete some directory
because I want use archetype to create a all in one project ,and delete some file and package by requiredProperty,
I can use Velocity show some code by #if like this:
#if(${mysql})
interface ${table....
-1
votes
1answer
22 views
How can we convert an existing java project with lib folder to Maven?
I have a old java project that does not use Maven or any other build tool. All the Dependencies/external jars that I need to run my project are located in a "libs" folder in my root ...
0
votes
0answers
19 views
how do I update maven parent version and child version for all the repositories in a given directory
I have a directory which has 15 services in it. Following is the structure
Main Directory/
- pom.xml
- Service A
|-src
|-pom.xml
- service B
|-src
...
0
votes
0answers
17 views
Maven not recognizing full file path
So I have this in my pom:
<build>
<directory>${project.parent.basedir}\build</directory>
</build>
and it outputs this error: Cannot create resource output directory: C:\Users\...
1
vote
0answers
21 views
Error: Could not find or load main class com.intellij.rt.junit.JUnitStarter after update Intellij IDE to 2021.1
I updated my Intellij IDE to:
IntelliJ IDEA 2021.1 (Ultimate Edition) Build #IU-211.6693.111, built
on April 6, 2021
I have started to get this message after unit tests finishing since I updated ...
0
votes
1answer
16 views
Error when running docker and maven from shell script
I can run the following line from the command line with correct results:
docker run --rm -v $PWD/java-app:/app -v /root/.m2/:/root/.m2/ -w /app maven:3-alpine mvn -B -DskipTests clean package
Based ...
0
votes
0answers
11 views
Maven-publish plugin with signing doesn't upload POM file
I have this root project build.gradle file(there are also sub-projects) and whenever I execute gradle publish it uploads everything to the designated repos except the POM file.
If I comment out the ...
0
votes
0answers
12 views
Why am I getting `java.lang.AssertionError: Built-in class kotlin.Any is not found` when using `copy` in TeamCity DSL?
Background
I'm trying to create some Teamcity configuration using Kotlin. I'm using a Maven in Intellij when testing the generation of the Teamcity, although I get the same result by using the ...
3
votes
0answers
26 views
“java.lang.IllegalArgumentException: System memory 259522560 must be at least 471859200” after installing Java 1.8 32 bits
After installing Java 8 32 bits on my computer to perform an unrelated task, I get the above exception when running mvn install on my spark-scala project.
I am using IntelliJ and Java 8 of 64 bits for ...
-1
votes
0answers
12 views
I have migrated maven project from java 8 to java 11.Project is multi module. While testing it with sample jax-rs app I am getting below error [closed]
//getting below error on java 11 and working on java 8.
//I have to import two maven project to run this sample-jax-rs app and I have made changes for jdk 11 in both.
com.typesafe.config....
0
votes
0answers
17 views
Handling different versions of a dependency in Maven based on an environment variable
I have a question regarding adding different versions of dependencies in Maven. We have a dependency on a third party plugins in our project. I want to create different builds based on the version of ...
0
votes
0answers
32 views
Main class not generated in manifest file
The problem I have is that when I build a project and then tries to run the jar file nothing happens. When I run java -jar Tried-1.jar I get this error message:
no main manifest attribute, in Tried-1....
0
votes
0answers
7 views
Error building docker image using maven plugin
I'm trying to build a docker image using maven plugin.I'm using Spotify docker plugin in my spring boot application.
Here is the plugin section of my pom.xml
<plugins>
<plugin>
...
0
votes
0answers
21 views
Enteries in Maven Project POM with <systemPath> tag does not get included in the generated war file
I have added some maven dependencies with SystemPath tag,
<dependency>
<groupId>OFRestCallBroker</groupId>
<artifactId>OFRestCallBroker</artifactId>
...
0
votes
0answers
25 views
Maven build is picking different Jackson artefacts version on different hosts
I have multi-module projects, which has a multiple Jackson version, though in recently added module POM and Main Project POM it's 2.9.8 (included specifically).
and One of the modules has...
@...
0
votes
0answers
16 views
How to mavenize eclipse RCP application?
Current state:
Multi-module Java 6 project using Eclipse plugins, application is distributed for Windows platform only as an exe file with directories with many jars and some init and configuration ...
0
votes
0answers
16 views
Build not performed for all projects in release of multi-module Maven projects
I'm having an issue with build during release of multi-module Maven projects. I have this structure:
parent
|-- potato
|-- lettuce
|-- raddish
and I want to release projects potato and lettuce. (They ...
0
votes
0answers
18 views
It is possible to store and print the output from subprocess.run() in Python?
I have this code in Python3:
build_output = subprocess.run(maven_command, capture_output=True, text=True, shell=True)
and I wonder if it's possible to store further the output in build_output and ...
0
votes
0answers
12 views
How to fix Absolute Path Traversal in MavenWrapperDownloader.java
After a security scan, I get the error Absolute Path Traversal in the file:
https://github.com/takari/maven-wrapper/blob/master/.mvn/wrapper/MavenWrapperDownloader.java
Line 50:
File baseDirectory = ...
1
vote
0answers
31 views
Stacktrace filled with random caotic characters on console
after runnig
mvn surefire-report:report
unexpectedly started to appear errors on the console similar to:
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at ...
0
votes
0answers
7 views
increase maven log buffer size in intellJ
I'm trying to debug a discepancy between the console maven build and the maven build run through the intelliJ maven integration.
Problem is, if I enable debug output, the output buffer of the run ...
0
votes
0answers
11 views
AWS - K8S container reacts strange with docker image [closed]
I experience a very weird behavior running my image on K8S pod.
Pod resources are from AWS.
The situation is:
I have created a docker image (Alpine). When I run the docker locally on my Mac, I execute ...
0
votes
0answers
13 views
Maven TestNG - Command Line Execution Not Triggering @Before or @After Methods
I am trying to execute my Maven project (created in Apache Netbeans) via command line.
Here is my pom.xml file
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="...
0
votes
0answers
15 views
Setting annotationProcessor in maven-compiler-plugin then @Slf4j doesnt work : cannot find symbol
I added an annotation processor and set it in maven:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
...
2
votes
0answers
26 views
Why can't Maven run tests but VSCode can? [duplicate]
So when I try to run some tests on Maven , tests can't find Junit tests , but when I run on VSCode , the tests are running . I tried to look some solution on Stack Overflow , but nothing similar to my ...
0
votes
2answers
28 views
org.springframework.experimental:spring-aot-maven-plugin:jar:0.9.2 was not found
I added the dependency and plugins using this documentation-
https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/
I also tried-
mvn clean install
.But I keep getting this error-
...