I have written a spring boot application. I have written Junit test cases as well for that. When i run mvn clean install command, test cases are not running as part of that mvn build. But when i just right click and run as Junit test case all my test cases execute. I believe there is some configuration error.
Am using spring-boot, maven as build and Eclipse ide.
My test class name is TestService.java and it is in src/test folder
public class TestService {
JsonUtil jsonUtil;
String jsonString;
#Before
public void setData() {
jsonString = "{\"id\":\"one\"}";
jsonUtil = new JsonUtil(new ObjectMapper());
}
#Test
public void testGetStringAsJson() {
JsonNode node = jsonUtil.getStringAsJson(jsonString);
Assert.assertEquals("one", node.get("id").textValue());
}
}
Below is my pom.xml
<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.xyz</groupId>
<artifactId>xyz</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>xyz</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<!-- dependency versions -->
<com.google.guava.guava.version>22.0</com.google.guava.guava.version>
<io.springfox.springfox-swagger2>2.7.0</io.springfox.springfox-swagger2>
<io.springfox.springfox-swagger-ui>2.7.0</io.springfox.springfox-swagger-ui>
</properties>
<dependencies>
<!-- For default Spring Boot utilities -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- For testing possibility -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- For all mvc and web functions -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
<!-- Spring security related dependencies
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
</dependency>-->
<!-- Default persistence functions -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-java8</artifactId>
<version>5.0.5.Final</version>
</dependency>
<!-- In-Memory DB -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Java Utilities from google -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${com.google.guava.guava.version}</version>
</dependency>
<!-- Include swagger for API description -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${io.springfox.springfox-swagger2}</version>
</dependency>
<!-- Include swagger for API description UI -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${io.springfox.springfox-swagger-ui}</version>
</dependency>
<!-- Common libraries -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Maven output
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xyz 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) # xyz ---
[INFO] Deleting C:\Users\rk\Documents\WS\xyz\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # xyz ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # xyz ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 17 source files to C:\Users\rk\Documents\WS\xyz\target\classes
[WARNING] /C:/Users/rk/Documents/WS/xyz/src/main/java/com/weather/xyzTestApplication.java: C:\Users\rk\Documents\WS\xyz\src\main\java\com\weather\xyzTestApplication.java uses or overrides a deprecated API.
[WARNING] /C:/Users/rk/Documents/WS/xyz/src/main/java/com/weather/xyzTestApplication.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # xyz ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # xyz ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to C:\Users\rk\Documents\WS\xyz\target\test-classes
[WARNING] /C:/Users/rk/Documents/WS/xyz/src/test/java/com/weather/controller/TestxyzController.java: C:\Users\rk\Documents\WS\xyz\src\test\java\com\weather\controller\TestxyzController.java uses unchecked or unsafe operations.
[WARNING] /C:/Users/rk/Documents/WS/xyz/src/test/java/com/weather/controller/TestxyzController.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # xyz ---
[INFO]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) # xyz ---
[INFO] Building jar: C:\Users\rk\Documents\WS\xyz\target\xyz-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.4.RELEASE:repackage (default) # xyz ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # xyz ---
[INFO] Installing C:\Users\rk\Documents\WS\xyz\target\xyz-0.0.1-SNAPSHOT.jar to C:\Users\rk\.m2\repository\com\weather\xyz\0.0.1-SNAPSHOT\xyz-0.0.1-SNAPSHOT.jar
[INFO] Installing C:\Users\rk\Documents\WS\xyz\pom.xml to C:\Users\rk\.m2\repository\com\weather\xyz\0.0.1-SNAPSHOT\xyz-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.643 s
[INFO] Finished at: 2018-09-24T22:44:24+05:30
[INFO] Final Memory: 34M/248M
[INFO] ------------------------------------------------------------------------
Check pom.xml go to 'Effective POM' view.
Check the value for tag under . It seems like it is not pointing to the proper location. You may override the property in pom.xml if it is pointing to a different location.
How would you have created the pom through spring initializer or manually? Most likely build path issue causing plugin not to execute. Can you check which version is being used once run through eclipse later verify through mvn dependency: tree just to know the same version is also available from cmd.
Related
I am trying to get my first AspectJ aspect running. Setup looks ok to me, following the documentation I can find. e.g.
developers site: https://github.com/kriegaex/org.aspectj
set up instructions: https://github.com/eclipse/org.aspectj/blob/master/docs/developer/IDE.md
join point examples: https://www.eclipse.org/aspectj/doc/released/progguide/language-joinPoints.html
But no aspect will fire, no matter what options I have tried during all today.
I believe the pointcuts is correctly pointing to my method call because I was getting the error about pointcuts not being used when I changed it. (Thats not happening now - dont know what I did :-())
So is the problem in the setup? The pointcuts? How do you go about de-bugging such a situation? Am I missing something in the docs?
POM
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.14.0</version>
<!--
<groupId>dev.aspectj</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.13.2-SNAPSHOT</version>
-->
<executions>
<execution>
<goals>
<goal>compile</goal> <!-- use this goal to weave all your main classes -->
<goal>test-compile</goal> <!-- use this goal to weave all your test classes -->
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.9.7</version>
</dependency>
</dependencies>
<configuration>
<showWeaveInfo>true</showWeaveInfo>
<forceAjcCompile>true</forceAjcCompile>
<sources/>
<weaveDirectories>
<weaveDirectory>${project.build.directory}/classes</weaveDirectory>
</weaveDirectories>
<complianceLevel>11</complianceLevel>
<source>11</source>
<target>11</target>
<verbose>true</verbose>
<Xlint>warning</Xlint>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
.....
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>22.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/dev.aspectj/aspectj-maven-plugin -->
<dependency>
<groupId>dev.aspectj</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.13.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjrt -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.9.7</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.7</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjtools -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.9.7</version>
</dependency>
</dependencies>
ASPECT
public aspect MdDOMAINChildAspect {
pointcut myExceptionHandlerPointcut(): execution(void mdDOMAIN.MdDOMAINInstance.testCall() );
before(): myExceptionHandlerPointcut() {
System.out.println("-------------- Aspect Advice Logic ---------------");
}
CLASS
#Data
public class MdDOMAINInstance {
#MdDOMAINChildAnnotation(selectName = "Indicators")
public MdDOMAINInstance selectFilingIndicators() throws NoSuchMethodException {
testCall();
Method m=this.getClass().getMethod("selectFilingIndicators");
MdDOMAINChildAnnotation metaidAnnotation=m.getAnnotation(MdDOMAINChildAnnotation.class);
System.out.println("Annotation: " + metaidAnnotation.selectName());
return this;
}
public void testCall()
{
System.out.println("In testCall()");
return ;
}
}
TEST
class MdDOMAINInstanceTest {
#Test
void selectFilingIndicatorsTest() throws NoSuchMethodException {
MdDOMAINInstance mdDOMAINInstance = new MdDOMAINInstance().selectFilingIndicators();
}
}
MAVEN TEST RUN
clean test -Dtest=MdDOMAINInstanceTest -f pom.xml
MAVEN TEST RUN OUTCOME
"C:\Program Files\Java\jdk-11.0.12\bin\java.exe" -Dmaven.multiModuleProjectDirectory=....IdeaProjects\us-MYROOT-DOMAIN-004 "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\lib\idea_rt.jar=52349:C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2021.3.2 clean test -Dtest=MdDOMAINInstanceTest
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for us-MYROOT:us-MYROOT-DOMAIN-004:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.version' for org.junit.jupiter:junit-jupiter:jar is either LATEST or RELEASE (both of them are being deprecated) # line 117, column 22
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 20, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] --------------< us-MYROOT:us-MYROOT-DOMAIN-004 >--------------
[INFO] Building us-MYROOT-DOMAIN-004 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # us-MYROOT-DOMAIN-004 ---
[INFO] Deleting .....IdeaProjects\us-MYROOT-DOMAIN-004\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # us-MYROOT-DOMAIN-004 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # us-MYROOT-DOMAIN-004 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to .....IdeaProjects\us-MYROOT-DOMAIN-004\target\classes
[INFO]
[INFO] --- aspectj-maven-plugin:1.14.0:compile (default) # us-MYROOT-DOMAIN-004 ---
[INFO] Showing AJC message detail for messages of types: [error, warning, fail]
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # us-MYROOT-DOMAIN-004 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # us-MYROOT-DOMAIN-004 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to .....IdeaProjects\us-MYROOT-DOMAIN-004\target\test-classes
[INFO]
[INFO] --- aspectj-maven-plugin:1.14.0:test-compile (default) # us-MYROOT-DOMAIN-004 ---
[INFO] Showing AJC message detail for messages of types: [error, warning, fail]
[WARNING] You aren't using a compiler supported by lombok, so lombok will not work and has been disabled.
Your processor is: org.aspectj.org.eclipse.jdt.internal.compiler.apt.dispatch.BatchProcessingEnvImpl
Lombok supports: OpenJDK javac, ECJ
<unknown source file>:<no line information>
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) # us-MYROOT-DOMAIN-004 ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running mdDOMAIN.MdDOMAINInstanceTest
In testCall()
Annotation: Indicators
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.065 s - in mdDOMAIN.MdDOMAINInstanceTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.238 s
[INFO] Finished at: 2022-10-21T20:14:46+11:00
[INFO] ------------------------------------------------------------------------
Process finished with exit code 0
Have you tried without Lombok in order to avoid this problem? Try doing manually in your test class what the Lombok annotation does instead.
After we have established that this solves the problem, we can start looking into possible workarounds. If this really is your first AspectJ problem, you should not start with a difficult mix like AspectJ + Lombok.
Besides, if your #Data class is immutable, you might not need Lombok at all and could use a recent Java version and native Java records for that.
I'm attempting to display the full tree of dependencies for a project I'm working on using the maven-dependency-plugin version 3.1.2 from the command line, but the mvn dependency:tree goal (nor any of the other goals from the maven-dependency-plugin) is not showing the test dependencies. The documentation of the plugin (https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html) states that all scopes are included by default, so using the -Dscope=test shouldn't be necessary (but when adding this parameter, the output doesn't change).
I've run this with a clean .m2 repository, using no settings.xml file (to ensure that all artifacts are coming directly from repo.maven.apache.org).
I'm running using maven 3.6.2 on a linux environment (CentOS 7) and using Oracle Java 1.8.0_144
Here's my POM:
<?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.sw-eval</groupId>
<artifactId>cayenne-eval</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne-server</artifactId>
<version>4.2.M2</version>
</dependency>
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne-di</artifactId>
<version>4.2.M2</version>
</dependency>
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne-dbsync</artifactId>
<version>4.2.M2</version>
</dependency>
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne-client</artifactId>
<version>4.2.M2</version>
</dependency>
</dependencies>
</project>
Here's the output I receive from running the command mvn dependency:tree:
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.sw-eval:cayenne-eval >----------------------
[INFO] Building cayenne-eval 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # cayenne-eval ---
[INFO] com.sw-eval:cayenne-eval:jar:1.0.0-SNAPSHOT
[INFO] +- org.apache.cayenne:cayenne-server:jar:4.2.M2:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- org.apache.cayenne:cayenne-di:jar:4.2.M2:compile
[INFO] +- org.apache.cayenne:cayenne-dbsync:jar:4.2.M2:compile
[INFO] | +- org.apache.cayenne:cayenne-project:jar:4.2.M2:compile
[INFO] | \- net.java.dev.inflector:inflector:jar:0.7.0:compile
[INFO] \- org.apache.cayenne:cayenne-client:jar:4.2.M2:compile
[INFO] +- com.caucho:hessian:jar:4.0.63:compile
[INFO] \- org.apache.cayenne:cayenne-rop-server:jar:4.2.M2:compile
[INFO] +- org.apache.cayenne:cayenne-web:jar:4.2.M2:compile
[INFO] \- org.slf4j:slf4j-simple:jar:1.7.25:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.951 s
[INFO] Finished at: 2020-11-25T08:53:17-07:00
[INFO] ------------------------------------------------------------------------
When referring to the cayenne-server pom, however, there are many dependencies marked as test which are not shown in the output (specifically, the following are direct dependencies of cayenne-server, see https://search.maven.org/artifact/org.apache.cayenne/cayenne-server/4.2.M2/jar):
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cayenne.build-tools</groupId>
<artifactId>cayenne-test-utilities</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mockrunner</groupId>
<artifactId>mockrunner-jdbc</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- this one have old Xerces dependency that clashes with JDK's one -->
<groupId>nekohtml</groupId>
<artifactId>nekohtml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<scope>test</scope>
</dependency>
So, is there something that I'm missing that needs to be enabled to show these test-scoped dependencies, and / or is this a weird artifact unique to the cayenne-server dependency?
Thanks in advance!
Dependencies of scope test are not transitive.
The test dependencies of your dependencies are not part of your dependency tree. They are ignored by Maven.
I hope some one facing the same issue to resolving the dependencies. POM.xml file mentioned below
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4.0.0
<parent>
<groupId>com.shopizer</groupId>
<artifactId>habbit</artifactId>
<version>2.12.0</version>
</parent>
<artifactId>habbit-core</artifactId>
<packaging>jar</packaging>
<name>habbit-core</name>
<url>http://www.shopizer.com</url>
<properties>
<coverage.lines>.00</coverage.lines>
<coverage.branches>.00</coverage.branches>
<google-client-maps-services-version>0.1.6</google-client-maps-services-version>
</properties>
<dependencies>
<!-- jpa, crud repository -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-ehcache -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
</dependency>
<!-- sm-core-model -->
<dependency>
<groupId>com.shopizer</groupId>
<artifactId>habbit-core-model</artifactId>
</dependency>
<!-- sm-core-modules -->
<dependency>
<groupId>com.shopizer</groupId>
<artifactId>habbit-core-modules</artifactId>
</dependency>
<!-- canadapost -->
<dependency>
<groupId>com.shopizer</groupId>
<artifactId>shopizer-shipping-canadapost-module</artifactId>
<version>${shopizer-canadapost.version}</version>
</dependency>
<!-- Google Map API -->
<dependency>
<groupId>com.google.maps</groupId>
<artifactId>google-maps-services</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-ci</artifactId>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-decisiontables</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
</dependency>
<!--spring integration -->
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-spring</artifactId>
</dependency>
<!-- end rules engine -->
<!-- Infinispan -->
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-tree</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<!--<version>${commons-collections4.version}</version> -->
</dependency>
<!-- https://mvnrepository.com/artifact/commons-validator/commons-validator -->
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<!--<version>${commons-validator.version}</version> -->
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-s3 -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-ses -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-ses</artifactId>
</dependency>
<!-- google cloud storage -->
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Payment dependencies -->
<!-- Paypal -->
<dependency>
<groupId>com.paypal.sdk</groupId>
<artifactId>merchantsdk</artifactId>
</dependency>
<!-- Stripe -->
<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
</dependency>
<!-- Braintree -->
<dependency>
<groupId>com.braintreepayments.gateway</groupId>
<artifactId>braintree-java</artifactId>
</dependency>
<!-- Invoices -->
<!-- <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId>
</dependency> <dependency> <groupId>org.jopendocument</groupId> <artifactId>jOpenDocument</artifactId>
</dependency> -->
<!-- https://mvnrepository.com/artifact/com.maxmind.geoip2/geoip2 -->
<dependency>
<groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId>
</dependency>
<!-- google cloud storage -->
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<!-- Up to date for GCP storage issue -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- tests dependencies -->
<!-- http://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<!-- H2 DB -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<!-- Elastic search -->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>com.shopizer</groupId>
<artifactId>sm-search</artifactId>
<exclusions>
<exclusion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
when I run command mvn clean install:-
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 6 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 6 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] habbit [pom]
[INFO] habbit-core-model [jar]
[INFO] habbit-core-modules [jar]
[INFO] habbit-core [jar]
[INFO] habbit-shop-model [jar]
[INFO] habbit-shop [jar]
[INFO]
[INFO] ------------------------< com.shopizer:habbit >-------------------------
[INFO] Building habbit 2.12.0 [1/6]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # habbit ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.3:prepare-agent (default-prepare-agent) # habbit ---
[INFO] argLine set to -javaagent:C:\\Users\\Hp\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.8.3\\org.jacoco.agent-0.8.3-runtime.jar=destfile=D:\\myProject\\h
abbit\\target\\jacoco.exec
[INFO]
[INFO] -------------------< com.shopizer:habbit-core-model >-------------------
[INFO] Building habbit-core-model 2.12.0 [2/6]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # habbit-core-model ---
[INFO] Deleting D:\myProject\habbit\habbit-core-model\target
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.3:prepare-agent (default-prepare-agent) # habbit-core-model ---
[INFO] argLine set to -javaagent:C:\\Users\\Hp\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.8.3\\org.jacoco.agent-0.8.3-runtime.jar=destfile=D:\\myProject\\h
abbit\\habbit-core-model\\target\\jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # habbit-core-model ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\myProject\habbit\habbit-core-model\src\main\resources
[INFO] skip non existing resourceDirectory D:\myProject\habbit\habbit-core-model\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # habbit-core-model ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 182 source files to D:\myProject\habbit\habbit-core-model\target\classes
[INFO]
[INFO] ------------------< com.shopizer:habbit-core-modules >------------------
[INFO] Building habbit-core-modules 2.12.0 [3/6]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # habbit-core-modules ---
[INFO] Deleting D:\myProject\habbit\habbit-core-modules\target
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.3:prepare-agent (default-prepare-agent) # habbit-core-modules ---
[INFO] argLine set to -javaagent:C:\\Users\\Hp\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.8.3\\org.jacoco.agent-0.8.3-runtime.jar=destfile=D:\\myProject\\h
abbit\\habbit-core-modules\\target\\jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # habbit-core-modules ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\myProject\habbit\habbit-core-modules\src\main\resources
[INFO] skip non existing resourceDirectory D:\myProject\habbit\habbit-core-modules\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # habbit-core-modules ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 14 source files to D:\myProject\habbit\habbit-core-modules\target\classes
[INFO]
[INFO] ----------------------< com.shopizer:habbit-core >----------------------
[INFO] Building habbit-core 2.12.0 [4/6]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for habbit 2.12.0:
[INFO]
[INFO] habbit ............................................. SUCCESS [ 2.919 s]
[INFO] habbit-core-model .................................. SUCCESS [ 14.010 s]
[INFO] habbit-core-modules ................................ SUCCESS [ 2.125 s]
[INFO] habbit-core ........................................ FAILURE [ 2.078 s]
[INFO] habbit-shop-model .................................. SKIPPED
[INFO] habbit-shop ........................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.245 s
[INFO] Finished at: 2020-05-22T15:12:57+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project habbit-core: Could not resolve dependencies for project com.shopizer:habbit-core:jar:2.12.0: Failed to collect dependenci
es at com.shopizer:shopizer-shipping-canadapost-module:jar:2.11.0 -> com.shopizer:sm-core-model:jar:2.10.0: Failed to read artifact descriptor for com.shopizer:sm-
core-model:jar:2.10.0: Failure to find com.shopizer:shopizer:pom:2.10.0 in https://oss.sonatype.org/content/repositories/snapshots/ was cached in the local reposit
ory, resolution will not be reattempted until the update interval of oss-sonatype has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :habbit-core
Remove canadapost-module from dependencies.
I'm aware that there are multiple threads going around in regards to this I have tried for up to 3 hours so I apologise for the repetition.
All I want to do is run mvn test to have it run the Junit 5 Tests. Pressing Run on IntelliJ works but mvn test in the terminal does not.
File structure is below -
https://user-images.githubusercontent.com/37623164/64642711-53cf1d80-d452-11e9-9764-849d73fcc5c9.png
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.petrego</groupId>
<artifactId>PetRego</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>PetRego</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
<version>1.4.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.0</version>
</plugin>
</plugins>
</build>
</project>
Returned Result in Logs -
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< com.petrego:PetRego >-------------------------
[INFO] Building PetRego 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # PetRego ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) # PetRego ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) # PetRego ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/639603/projects/PetRego/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) # PetRego ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.0:test (default-test) # PetRego ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.704 s
[INFO] Finished at: 2019-09-11T05:02:30+10:00
[INFO] ------------------------------------------------------------------------
In general, the first thing you should do is check if there are newer versions of plugins.
Upgrading surefire should fix your issue, see https://maven.apache.org/surefire/maven-surefire-plugin/
As #AKSW suggested in the questions there is an incorrect import.
I was importing org.junit.Test (Junit4) when I should been importing JUnit5 org.junit.jupiter.api.Test (JUnit5)
I have one application based on Maven + Spring.
It's a Java web application using java.
this is the pom.xml i'm using:
<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.alfred</groupId>
<artifactId>alfred</artifactId>
<version>v.0.1-CID.Fase.II.Edesk-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.7.RELEASE</version>
</parent>
<name>ALFRED</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.0</version>
</dependency>
<!-- Dependencia para Spring DATA JPA con base de datos -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- Para implementar las conexiones a la base de datos MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<!-- version>5.1.35</version -->
</dependency>
<!-- Para implementar el servicio REST -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<!-- http://mvnrepository.com/artifact/com.google.code.gson/gson -->
<!-- Paquete que permite convertir el contenido de una respuesta en texto
plano JSON a objetos Java. -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<!-- Para implementar cliente REST con Template -->
<!-- dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId>
</dependency -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- Para implementar las plantillas HTML con thymeleaf -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity3 -->
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity3</artifactId>
</dependency>
<!-- Para poder implementar los clientes de los servicios REST -->
<dependency>
<groupId>com.squareup.retrofit</groupId>
<artifactId>retrofit</artifactId>
<version>1.7.1</version>
</dependency>
<!-- Para escapar HTML en las llamadas a la API de IMDB -->
<!-- http://mvnrepository.com/artifact/commons-httpclient/commons-httpclient -->
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.0</version>
</dependency>
<!-- Spring Security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- Java Mail API -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-ldap -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<!-- LibrerÃa para tratar con excels -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.16</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!--<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId>
<configuration> DO NOT include log4j.properties file in your Jar <excludes>
<exclude>**/log4j.properties</exclude> </excludes> <archive> </archive> </configuration>
</plugin> -->
</plugins>
</build>
</project>
When I do the clean, generate resources and install appear this error and not start working
"C:\Program Files\Java\jdk1.8.0_151\bin\java"
-Dmaven.multiModuleProjectDirectory=C:\Users\spainasg\Documents\CID_UAT
-Dmaven.home=C:\Users\spainasg\Downloads\apache-maven-3.5.2-bin\apache-maven-3.5.2 -Dclassworlds.conf=C:\Users\spainasg\Downloads\apache-maven-3.5.2-bin\apache-maven-3.5.2\bin\m2.conf
-Dfile.encoding=UTF-8 -classpath C:\Users\spainasg\Downloads\apache-maven-3.5.2-bin\apache-maven-3.5.2\boot\plexus-classworlds-2.5.2.jar
org.codehaus.classworlds.Launcher -Didea.version=2017.2.6 --offline -s
C:\Users\spainasg.m2\settings.xml
-Dmaven.repo.local=C:\Users\spainasg.m2\repository clean generate-resources install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
com.alfred:alfred:war:v.0.1-CID.Fase.II.Edesk-SNAPSHOT
[WARNING] Detected profiles.xml alongside com.alfred:alfred:v.0.1-CID.Fase.II.Edesk-SNAPSHOT, this file is no
longer supported and was ignored, please use the settings.xml instead
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ALFRED v.0.1-CID.Fase.II.Edesk-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-install-plugin:jar:2.5.2 is missing, no
dependency information available
[WARNING] The POM for com.oracle:ojdbc14:jar:10.2.0.4.0 is missing, no dependency information available
[WARNING] The POM for org.thymeleaf.extras:thymeleaf-extras-springsecurity3:jar:2.1.2.RELEASE
is missing, no dependency information available
[WARNING] The POM for org.apache.poi:poi:jar:3.16 is missing, no dependency information available
[WARNING] The POM for org.apache.poi:poi-ooxml-schemas:jar:3.16 is missing, no dependency information available
[WARNING] The POM for com.github.virtuald:curvesapi:jar:1.04 is missing, no dependency information available
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # alfred ---
[INFO] Deleting C:\Users\spainasg\Documents\CID_UAT\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # alfred ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 90 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # alfred ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 174 source files to C:\Users\spainasg\Documents\CID_UAT\target\classes
[WARNING] /C:/Users/spainasg/Documents/CID_UAT/src/main/java/com/edesk/controladorGUI/GestionServicioAprobadorController.java:
C:\Users\spainasg\Documents\CID_UAT\src\main\java\com\edesk\controladorGUI\GestionServicioAprobadorController.java
uses unchecked or unsafe operations.
[WARNING] /C:/Users/spainasg/Documents/CID_UAT/src/main/java/com/edesk/controladorGUI/GestionServicioAprobadorController.java:
Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # alfred ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\spainasg\Documents\CID_UAT\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # alfred ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) # alfred ---
[WARNING] The POM for org.apache.maven.surefire:maven-surefire-common:jar:2.17 is missing,
no dependency information available
[WARNING] The POM for org.apache.maven.surefire:surefire-api:jar:2.17 is missing, no
dependency information available
[WARNING] The POM for org.apache.maven:maven-toolchain:jar:2.0.9 is missing, no dependency information available
[WARNING] The POM for org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.2 is
missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.961 s
[INFO] Finished at: 2017-11-30T09:45:30+01:00
[INFO] Final Memory: 29M/233M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test
(default-test) on project alfred: Execution default-test of goal
org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed:
Plugin org.apache.maven.plugins:maven-surefire-plugin:2.17 or one of
its dependencies could not be resolved: The following artifacts could
not be resolved:
org.apache.maven.surefire:maven-surefire-common:jar:2.17,
org.apache.maven.surefire:surefire-api:jar:2.17,
org.apache.maven:maven-toolchain:jar:2.0.9,
org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.2,
org.codehaus.plexus:plexus-utils:jar:1.1: Cannot access central
(https://repo.maven.apache.org/maven2) in offline mode and the
artifact org.apache.maven.surefire:maven-surefire-common:jar:2.17 has
not been downloaded from it before. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
[ERROR] Maven execution terminated abnormally (exit code 1)
I'm using IntelliJ, but have the same error using Eclipse.
The aplications are working offline.
Any idea for this solution?
Try to add all your missing dependencies.
[WARNING] The POM for org.apache.maven.surefire:maven-surefire-common:jar:2.17 is missing, no dependency information available
[WARNING] The POM for org.apache.maven.surefire:surefire-api:jar:2.17 is missing, no dependency information available
[WARNING] The POM for org.apache.maven:maven-toolchain:jar:2.0.9 is missing, no dependency information available
[WARNING] The POM for org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.2 is missing, no dependency information available