maven

ClassNotFoundException when running executable jar

岁酱吖の 提交于 2021-02-11 15:42:47
问题 I created a jar file for utility files and added it as a dependency for my main project. When I run mvn install to build my main project, the correct utility jar is used in my unit tests. However, when I later run the main project jar using java -jar supervisor.jar , I get a java.lang.NoClassDefFoundError: caused by java.lang.ClassNotFoundException: com.seeq.utilities.process.OperatingSystem . In my unit tests, OperatingSystem is used and the tests run fine, so I am assuming that the utility

Latest dependency versions of various Apache libraries from maven suddenly use a very old version

南楼画角 提交于 2021-02-11 15:23:20
问题 So I've been using various Apache commons libraries for a while and all was fine until suddenly when using the mvn versions:use-latest-versions command or the LATEST version tag uses/places a very old version of various Apache libraries into the <version> tag: <dependency> <groupId>commons-net</groupId> <artifactId>commons-net</artifactId> <version>20030805.205232</version> <!-- Note: 2003! --> </dependency> If we take a look at the maven repository of commons-net , we can tell that this is

Why do I need to set target folder as source folder? How was the project compiled for the first time when “target” wasn't cretaed?

本秂侑毒 提交于 2021-02-11 15:10:32
问题 I have an existing maven project (IDE used: Sprint Test Tool) and I have very very limited help available around it. I'm new to maven, java and stuff (I know basic java and have done automation in java but haven't worked on full-fledged java projects) and I have to figure our all of this project more or less by myself. I was trying to compile the package but it shows errors in main\src\java that "Messages can NOT be resolved" over some code of this sort: Messages.. I searched through the

How does plugin validation work in Maven, and why does it build my project with an invalid version?

让人想犯罪 __ 提交于 2021-02-11 14:52:24
问题 I have a Maven project that builds fine even though I have specified a completely invalid plugin in my POM: <build> <plugins> <plugin> <groupId>bla</groupId> <artifactId>bar</artifactId> <version>1.9.553342342343</version> <executions> <execution> <phase>compile</phase> </execution> </executions> <configuration> <project> <inceptionYear>123123</inceptionYear> <contributors> asdad </contributors> </project> </configuration> </plugin> </plugins> </build> I also don't see any errors in Eclipse

How to add data to testcase with JUnit and Maven Surefire Plugin

…衆ロ難τιáo~ 提交于 2021-02-11 14:27:30
问题 I have a running maven project with JUnit tests. The Maven Surefire Plugin drops xml files after the tests. These xml files include, besides properties and logprints, following information: <testcase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="methodNameForTest" classname="com.my.test.project.Testclass" time="20.931"> <error type="java.lang.NullPointerException">java.lang.NullPointerException</error> </testcase> Can someone explain me the usual way how data gets written from

Why is a java.lang.NoClassDefFoundError raised when I run my JAR with Apache Storm ? (org/apache/storm/kafka/spout/KafkaSpoutConfig)

拥有回忆 提交于 2021-02-11 14:25:43
问题 I started last week a formation in Kafka and Storm at OpenClassRooms. During practical work, I encounter an error when I try to execute a JAR containing my java code for Storm. No problem when compiling the project in Java, no problem when packaging with maven, the problem only occurs when running the JAR theirman@vm-debian:/data/eclipse-workspace/velos$ storm jar target/velos-1.0-SNAPSHOT.jar velos.App remote Running: /usr/lib/jvm/java/bin/java -client -Ddaemon.name= -Dstorm.options= -Dstorm

How to resolve class file for com.google.cloud.Service not found

拜拜、爱过 提交于 2021-02-11 14:13:57
问题 I am Trying to upload JSON data to gcs. As I did not use google cloud previously I started with uploading random String to gcs but I got stuck at the beginning itself while creating a Storage service object Maven dependency <dependency> <groupId>com.google.cloud</groupId> <artifactId>google-cloud-storage</artifactId> <version>1.70.0</version> </dependency> import com.google.cloud.storage.*; Storage storage = StorageOptions.getDefaultInstance().getService(); BlobId blobId = BlobId.of("bucket

How to run a single test case (method) instead of whole test suite (class) using Selenium/TestNG/Maven

元气小坏坏 提交于 2021-02-11 14:12:01
问题 So basically I am wondering how could I run a specific test case (a method) instead of running a whole class. I am running tests using a combination of Selenium/Maven/TestNG. My current testing setup looks something like this: simplified command to run tests: mvn test -DtestSuiteName="test" contents of test.xml used in the command above: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Selenium Testng Template"> <test name=

How to run a single test case (method) instead of whole test suite (class) using Selenium/TestNG/Maven

懵懂的女人 提交于 2021-02-11 14:11:45
问题 So basically I am wondering how could I run a specific test case (a method) instead of running a whole class. I am running tests using a combination of Selenium/Maven/TestNG. My current testing setup looks something like this: simplified command to run tests: mvn test -DtestSuiteName="test" contents of test.xml used in the command above: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Selenium Testng Template"> <test name=

problem creating an executable jar with maven using spring 5 and hibernate 5 => BeanDefinitionParsingException

随声附和 提交于 2021-02-11 13:48:18
问题 Update: As there is only one answer for now I try to describe it better now. In short words, my test application runs fine in eclipse and when starting with mvn exec but building a running/working executable jar package does not work for this project. Now the longer description. I'm learning Java for about 8 month and use maven to setup build projects and Eclipse as IDE for writing and debugging. Currently I am trying to make some small database projects using Spring, Hibernate and for