maven

Cucumber: Class not found com.example.runner.RunnerTest

喜你入骨 提交于 2021-01-24 11:46:45
问题 I have a maven project to run cucumber and selenium . The *.feature files are defined in the src/features , and the steps are defined in the src/test/java/com/example/steps . I have also defined a test runner class as below: package com.example.runner; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( features={"src/features"}, glue="com/example/steps") public class RunnerTest { } The problem is

Is possible override the version of a dependency in child POM?

淺唱寂寞╮ 提交于 2021-01-24 09:58:06
问题 I'm working with Maven to management the dependencies of my projects. I have my parent POM and I'm using Dependency Management to avoid write the common dependencies in each project. Now, I need change the version of one dependency in my child POM. I have this of my parent POM <dependencyManagement> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.1</version> </dependency> </dependencyManagement> My child POM has a reference to the parent POM

Version missing in dependencies for spring parent

我的梦境 提交于 2021-01-24 08:10:26
问题 I have the following pom.xml: <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.0.M2</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.example</groupId> <artifactId>auth-service</artifactId> <version>0.0.1-SNAPSHOT</version> <name>auth-service</name> <description>Authorization service</description> <properties> <java.version>11</java.version> <project

Version missing in dependencies for spring parent

梦想与她 提交于 2021-01-24 08:09:24
问题 I have the following pom.xml: <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.0.M2</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.example</groupId> <artifactId>auth-service</artifactId> <version>0.0.1-SNAPSHOT</version> <name>auth-service</name> <description>Authorization service</description> <properties> <java.version>11</java.version> <project

Version missing in dependencies for spring parent

余生长醉 提交于 2021-01-24 08:09:21
问题 I have the following pom.xml: <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.0.M2</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.example</groupId> <artifactId>auth-service</artifactId> <version>0.0.1-SNAPSHOT</version> <name>auth-service</name> <description>Authorization service</description> <properties> <java.version>11</java.version> <project

multi-module Maven project on Dockers

余生长醉 提交于 2021-01-24 08:03:53
问题 I have a multi-module maven project where the single modules are all runnable microservice applications containing their own Dockerfile, so in production every module will be a containerized application. The parent project, which contains the child-modules only contains the parent pom.xml and the docker-compose.yml I have tried to use the following Dockerfile (on sub-module level): FROM sgrio/java-oracle RUN apt-get update RUN apt-get install -y maven COPY ../pom.xml /usr/local/service

multi-module Maven project on Dockers

陌路散爱 提交于 2021-01-24 08:03:32
问题 I have a multi-module maven project where the single modules are all runnable microservice applications containing their own Dockerfile, so in production every module will be a containerized application. The parent project, which contains the child-modules only contains the parent pom.xml and the docker-compose.yml I have tried to use the following Dockerfile (on sub-module level): FROM sgrio/java-oracle RUN apt-get update RUN apt-get install -y maven COPY ../pom.xml /usr/local/service

单元测试-java

空扰寡人 提交于 2021-01-24 02:50:10
单元测试-java Maven项目 ​ 学java必学!!! 如果你不愿意变强,请百度搜索idea或Eclipse怎么使用Junit。 1. junit 测试 ​ 单元测试,也需要遵循一定的编程规范,不能随便的写一个地方,也要做到 格式规范,命名规范,结构规范 等等。 例如我要测试Demo类的方法: 怎么使用? 编写测试类 编写测试方法 点击运行 例如: import junit.framework.TestCase; import org.junit.Test; public class DemoTest { @Test public void fun1() { System.out.println(new Demo().fun1(2,1,5)); double v = new Demo().fun1(2, 1, 6); System.out.println(v); // 断言 TestCase.assertEquals(v,5.0); } } 2. main方法测试 ​ 对于单个简单的方法测试,我们可以通过main方法直接测试 例如: public class Demo { public static double fun1(int a, int b, double c){ if(a>0 && b>0){ c = c/a; } if(a>1 || c>1){ c = c + 1

Java - Maven - Reusing Entity layer at both client and server side projects

坚强是说给别人听的谎言 提交于 2021-01-24 01:44:11
问题 I am working on a Spring Boot, Hibernate, Thymeleaf project, I'm a bit confused to achieve the best architecture to reuse my entity layer. I have 2 Maven parent projects, I want to achieve the below project hierarchy with just creating one ProjectEntity (reusing it in both parents) ProjectAPIParent a) ProjectEntity b) ProjectRepository c) ProjectAPI ProjectClientUIParent a) ProjectEntity b) ProjectClientUI The problem is one child project cannot have multiple parents. Now, I have an option of