I am trying to follow this tutorial: http://www.tutorialspoint.com/maven/maven_snapshots.htm
I think I am running into problems with this though. When I run the pom.xml for the project in the myApp directory I receive the following output:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myApp 1
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.companyname.bank:consumerBanking:jar:1.0-SNAPSHOT is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # myApp ---
[INFO] Deleting C:\Users\name\Desktop\MavenFoo1\myApp\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # myApp ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\name\Desktop\MavenFoo1\myApp\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # myApp ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\name\Desktop\MavenFoo1\myApp\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # myApp ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\name\Desktop\MavenFoo1\myApp\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # myApp ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\name\Desktop\MavenFoo1\myApp\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # myApp ---
[INFO] Surefire report directory: C:\Users\name\Desktop\MavenFoo1\myApp\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.companyname.appid.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # myApp ---
[INFO] Building jar: C:\Users\name\Desktop\MavenFoo1\myApp\target\myApp-1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.141 s
[INFO] Finished at: 2015-02-25T15:29:16-06:00
[INFO] Final Memory: 10M/26M
[INFO] ------------------------------------------------------------------------
The WARNING message directly below [INFO] Building myApp 1 is what I think means that the myApp pom.xml is not successfully grabbing the latest SNAPSHOT for the other module it calls in its pom.xml.
The SNAPSHOT functionality should allow for another module to grab the latest version of the build for a different module that the first module depends on.
Below is my pom.xml for the first project, myApp, that depends on the latest version of another project.
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.companyname.appid</groupId>
<artifactId>myApp</artifactId>
<packaging>jar</packaging>
<version>1</version>
<name>myApp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.companyname.bank</groupId>
<artifactId>consumerBanking</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Now, below one will find the pom.xml for the consumerBanking project that the previous pom.xml for myApp depends on.
<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.companyname.bank</groupId>
<artifactId>consumerBanking</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>consumerBanking</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>c3p0-0.9.1.1</groupId>
<artifactId>c3p0-0.9.1.1</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\src\lib\c3p0-0.9.1.1.jar</systemPath>
</dependency>
</dependencies>
</project>
Does anyone know why I am receiving the WARNING? Does this mean the SNAPSHOT functionality is not working correctly? The message I am referring to is:
"The POM com.companyname.bank:consumerBanking:jar:1.0-SNAPSHOT is
invalid, transitive dependencies (if any) will not be available,
enable debug logging for more details"
Thank-you for reading all of this!
Regards,
me
I suppose Maven regards your dependency POM as invalid due to this section which does not make sense:
<dependency>
<groupId>c3p0-0.9.1.1</groupId>
<artifactId>c3p0-0.9.1.1</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\src\lib\c3p0-0.9.1.1.jar</systemPath>
</dependency>
Related
When i run mvn clean compile openjpa:enhance install i noticed compile goal running twice - once before openjpa:enhance and after it (also with resources), which causes enhanced classes with openjpa:enhance to be discarded, because they are compiled again and rewritten.
How to change pom.xml or mvn command arguments so it will not run compile twice, but only once before openjpa:enhance? install at the end is needed.
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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>registry</groupId>
<artifactId>datalayer</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.sourceEncoding>UTF-8</project.reporting.sourceEncoding>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<includes>datalayer/dto/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>
<executions>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.15.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<version>10.15.2.0</version>
</dependency>
</dependencies>
</project>
output from mvn clean compile openjpa:enhance install:
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< registry:openjpaenhancingtest >--------------------
[INFO] Building openjpaenhancingtest 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # openjpaenhancingtest ---
[INFO] Deleting C:\Users\wortigson\Desktop\ISMatrikaBcWorkspace\Openjpa.Test\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # openjpaenhancingtest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # openjpaenhancingtest ---
[WARNING] Can't extract module name from geronimo-jms_1.1_spec-1.1.1.jar: geronimo.jms.1.1.spec: Invalid module name: '1' is not a Java identifier
[WARNING] Can't extract module name from geronimo-jta_1.1_spec-1.1.1.jar: geronimo.jta.1.1.spec: Invalid module name: '1' is not a Java identifier
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to C:\Users\wortigson\Desktop\ISMatrikaBcWorkspace\Openjpa.Test\target\classes
[INFO]
[INFO] --- openjpa-maven-plugin:3.1.2:enhance (default-cli) # openjpaenhancingtest ---
88 DataLayer INFO [main] openjpa.Tool - Enhancer running on type "class entities.EntityPerson".
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # openjpaenhancingtest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # openjpaenhancingtest ---
[WARNING] Can't extract module name from geronimo-jms_1.1_spec-1.1.1.jar: geronimo.jms.1.1.spec: Invalid module name: '1' is not a Java identifier
[WARNING] Can't extract module name from geronimo-jta_1.1_spec-1.1.1.jar: geronimo.jta.1.1.spec: Invalid module name: '1' is not a Java identifier
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to C:\Users\wortigson\Desktop\ISMatrikaBcWorkspace\Openjpa.Test\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # openjpaenhancingtest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # openjpaenhancingtest ---
[WARNING] Can't extract module name from geronimo-jta_1.1_spec-1.1.1.jar: geronimo.jta.1.1.spec: Invalid module name: '1' is not a Java identifier
[WARNING] Can't extract module name from geronimo-jms_1.1_spec-1.1.1.jar: geronimo.jms.1.1.spec: Invalid module name: '1' is not a Java identifier
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # openjpaenhancingtest ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # openjpaenhancingtest ---
[INFO] Building jar: C:\Users\wortigson\Desktop\ISMatrikaBcWorkspace\Openjpa.Test\target\openjpaenhancingtest-0.0.1.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # openjpaenhancingtest ---
[INFO] Installing C:\Users\wortigson\Desktop\ISMatrikaBcWorkspace\Openjpa.Test\target\openjpaenhancingtest-0.0.1.jar to C:\Users\wortigson\.m2\repository\registry\openjpaenhancingtest\0.0.1\openjpaenhancingtest-0.0.1.jar
[INFO] Installing C:\Users\wortigson\Desktop\ISMatrikaBcWorkspace\Openjpa.Test\pom.xml to C:\Users\wortigson\.m2\repository\registry\openjpaenhancingtest\0.0.1\openjpaenhancingtest-0.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
You need to add openjpa:enhance to the POM itself. Then you just run mvn clean install.
I am continous getting this error on mvn clean verify tomcat7:run. i tried this command to resolve "mvn -Dhttps.protocols=TLSv1.2 clean install" but not get solved
error
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project fmissampletestdriver: Execution default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run failed: Plugin org.apache.tomcat.maven:tomcat7-maven-plugin:2.2 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.tomcat.maven:tomcat7-maven-plugin:jar:2.2 -> org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.47: Failed to read artifact descriptor for org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.47: Could not transfer artifact org.apache.tomcat.embed:tomcat-embed-core:pom:7.0.47 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/7.0.47/tomcat-embed-core-7.0.47.pom: Received fatal alert: protocol_version -> [Help 1]
Command Prompt Output
Microsoft Windows [Version 10.0.18363.1256]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\aksha>cd C:\Users\aksha\fmis-sample-test-driver
C:\Users\aksha\fmis-sample-test-driver>mvn clean verify tomcat7:run
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< com.ncrcoe.di.test:fmissampletestdriver >---------------
[INFO] Building Test Driver for Sample TPV 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # fmissampletestdriver ---
[INFO] Deleting C:\Users\aksha\fmis-sample-test-driver\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # fmissampletestdriver ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # fmissampletestdriver ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 6 source files to C:\Users\aksha\fmis-sample-test-driver\target\classes
[WARNING] /C:/Users/aksha/fmis-sample-test-driver/src/main/java/com/ncr/di/genenveloped/util/DocumentSigner.java: C:\Users\aksha\fmis-sample-test-driver\src\main\java\com\ncr\di\genenveloped\util\DocumentSigner.java uses unchecked or unsafe operations.
[WARNING] /C:/Users/aksha/fmis-sample-test-driver/src/main/java/com/ncr/di/genenveloped/util/DocumentSigner.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # fmissampletestdriver ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # fmissampletestdriver ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 5 source files to C:\Users\aksha\fmis-sample-test-driver\target\test-classes
[WARNING] /C:/Users/aksha/fmis-sample-test-driver/src/test/java/com/ncr/di/genenveloped/util/ResponseSenderTest.java:[5,24] sun.net.www.http.PosterOutputStream is internal proprietary API and may be removed in a future release
[WARNING] /C:/Users/aksha/fmis-sample-test-driver/src/test/java/com/ncr/di/genenveloped/util/ResponseSenderTest.java:[66,15] sun.net.www.http.PosterOutputStream is internal proprietary API and may be removed in a future release
[WARNING] /C:/Users/aksha/fmis-sample-test-driver/src/test/java/com/ncr/di/genenveloped/util/ResponseSenderTest.java:[66,56] sun.net.www.http.PosterOutputStream is internal proprietary API and may be removed in a future release
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # fmissampletestdriver ---
[INFO] Surefire report directory: C:\Users\aksha\fmis-sample-test-driver\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.ncr.di.genenveloped.data.AssertionTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.601 sec
Running com.ncr.di.genenveloped.data.SAMLResponseTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.548 sec
Running com.ncr.di.genenveloped.util.DocumentSignerTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.305 sec
Running com.ncr.di.genenveloped.util.ResponseSenderTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.232 sec
Results :
Tests run: 31, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-war-plugin:2.5:war (default-war) # fmissampletestdriver ---
[INFO] Packaging webapp
[INFO] Assembling webapp [fmissampletestdriver] in [C:\Users\aksha\fmis-sample-test-driver\target\fmisSampleTestDriver]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\aksha\fmis-sample-test-driver\src\main\webapp]
[INFO] Webapp assembled in [296 msecs]
[INFO] Building war: C:\Users\aksha\fmis-sample-test-driver\target\fmisSampleTestDriver.war
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:run (default-cli) > process-classes # fmissampletestdriver >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # fmissampletestdriver ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # fmissampletestdriver ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:run (default-cli) < process-classes # fmissampletestdriver <<<
[INFO]
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) # fmissampletestdriver ---
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/7.0.47/tomcat-embed-core-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-util/7.0.47/tomcat-util-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-coyote/7.0.47/tomcat-coyote-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-api/7.0.47/tomcat-api-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-jdbc/7.0.47/tomcat-jdbc-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-dbcp/7.0.47/tomcat-dbcp-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-servlet-api/7.0.47/tomcat-servlet-api-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-jsp-api/7.0.47/tomcat-jsp-api-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-jasper/7.0.47/tomcat-jasper-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-jasper-el/7.0.47/tomcat-jasper-el-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-el-api/7.0.47/tomcat-el-api-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-catalina/7.0.47/tomcat-catalina-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-tribes/7.0.47/tomcat-tribes-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-catalina-ha/7.0.47/tomcat-catalina-ha-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/7.0.47/tomcat-annotations-api-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-juli/7.0.47/tomcat-juli-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-logging-juli/7.0.47/tomcat-embed-logging-juli-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-logging-log4j/7.0.47/tomcat-embed-logging-log4j-7.0.47.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/eclipse/jdt/core/compiler/ecj/4.2.2/ecj-4.2.2.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/maven/common-tomcat-maven-plugin/2.2/common-tomcat-maven-plugin-2.2.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/tomcat/maven/tomcat7-war-runner/2.2/tomcat7-war-runner-2.2.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.pom
Downloading from central: https://repo.maven.apache.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/2.1.1/plexus-archiver-2.1.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.15/plexus-utils-3.0.15.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-filtering/1.0/maven-filtering-1.0.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/slf4j/jcl-over-slf4j/1.7.5/jcl-over-slf4j-1.7.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.709 s
[INFO] Finished at: 2020-12-16T18:10:03+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project fmissampletestdriver: Execution default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run failed: Plugin org.apache.tomcat.maven:tomcat7-maven-plugin:2.2 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.tomcat.maven:tomcat7-maven-plugin:jar:2.2 -> org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.47: Failed to read artifact descriptor for org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.47: Could not transfer artifact org.apache.tomcat.embed:tomcat-embed-core:pom:7.0.47 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/7.0.47/tomcat-embed-core-7.0.47.pom: Received fatal alert: protocol_version -> [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
C:\Users\aksha\fmis-sample-test-driver>
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ncrcoe.di.test</groupId>
<artifactId>fmissampletestdriver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Test Driver for Sample TPV</name>
<url>http://maven.apache.org</url>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.8</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>fmisSampleTestDriver</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.5</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>9090</port>
<path>/</path>
</configuration>
</plugin>
</plugins>
</build>
</project>
Try to put '-tomcatConfig' in profile and put again 'tomcatConfig' in profile, it works for me...
I try to run my test as -mvn test, it is showing as build is success but , No Source to Compile.Down I have attached my both pom and Result file.
Output :
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Wepaythemax 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Wepaythemax ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\rck\git\repository3\Wepaythemax\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # Wepaythemax ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # Wepaythemax ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # Wepaythemax ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # Wepaythemax ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.051 s
[INFO] Finished at: 2018-12-20T18:37:53+05:30
[INFO] Final Memory: 10M/114M
Pom.xml File
<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>Wepaythemax</groupId>
<artifactId>Wepaythemax</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.141.5</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>selenium-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Help Me out, Where I have done Mistake, I can't find out. I'm Trying to Figure it out.Also I have attached a Screenshot Where the My testng.xml file is placed
no sources to compile, means no java file in src/main/java or src/test/java.
sources are in src/main/java, sources is different from resources, which means .xml,etc.
I'm new to Maven, so excuse me if this is so elemental. I have searched about this problem, and everyone seems to solve it removing the tag from the pom.xml file.
I do not have that tag there:
<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>GraphApp</groupId>
<artifactId>GraphApp</artifactId>
<version>1.0.0</version>
<name>MyApp</name>
<description>MyApp</description>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
I have converted an existing project with Eclipse, so the problem may come from that.
Also, I have read that the default schema for Maven is storing the code at some default folders, while I'm using src/com/romanrdgz/core/myapp and /test/com/romanrdgz/test/core. That could also be the origin of the problem.
I am seeing this error:
Maven: package org.junit does not exist
What do I need to change?
EDIT: Ok, I have included JUnit4 as dependency, and I have also changed my file folders to be like this:
Still, when I go to console and execute mvn test or mvn compile, I get the following output:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GraphApp 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # GraphApp -
--
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\rrrp\workspace\GraphApp\src\
main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # GraphApp ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.515 s
[INFO] Finished at: 2015-04-15T08:15:06+02:00
[INFO] Final Memory: 11M/309M
[INFO] ------------------------------------------------------------------------
I tried erasing bin and target folders, but still the same. Looks like it does not find the classes nor the tests.
Any help?
Add the junit dependency to the pom file in a dependencies section
<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">
.....
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
</dependencies>
</project>
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I created a new maven project in Eclipse that runs simple test by using both HtmlUnitDriver and FirefoxDriver to pull up a web page and check the title on the page. When I run maven command mvn test this is all that I get:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # my-app ---
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/Andrew/Development/code/my-app/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # my-app ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # my-app ---
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/Andrew/Development/code/my-app/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # my-app ---
[WARNING] File encoding has not been set, using platform encoding MacRoman, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /Users/Andrew/Development/code/my-app/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # my-app ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.049s
[INFO] Finished at: Fri Jan 31 11:53:38 EST 2014
[INFO] Final Memory: 12M/81M
[INFO] ------------------------------------------------------------------------
When I run the same Maven command in Eclipse, it shows the following:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # my-app ---
[debug] execute contextualize
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/Andrew/Development/code/my-app/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # my-app ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # my-app ---
[debug] execute contextualize
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/Andrew/Development/code/my-app/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # my-app ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) # my-app ---
[INFO] Surefire report directory: /Users/Andrew/Development/code/my-app/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.878s
[INFO] Finished at: Fri Jan 31 11:58:23 EST 2014
[INFO] Final Memory: 5M/81M
[INFO] ------------------------------------------------------------------------
This is my pom.xml for those who want to check if that may be the issue:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.39.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire</artifactId>
<version>2.16</version>
<type>pom</type>
</dependency>
</dependencies>
</project>
Did you mean to add org.apache.maven.surefire as a POM dependency under <dependencies>?
Most usages of the Surefire plugin are configured under the <pluginManagement> section:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
</plugin>
</plugins>
</pluginManagement>
</build>