I have created Selenium IDE test cases and have tested them in Eclipse. The project is a Maven java project and the tests will run fine in Eclipse however, when I add the project to Jenkins and try to build my project, there is a error and a build failure.
The error:
Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\Selenium IDE Recon
Parsing POMs
Discovered a new module Test:SeleniumTest SeleniumTest
Modules changed, recalculating dependency graph
[Selenium IDE Recon] $ C:\java/bin/java -cp "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-agent-1.5.jar;C:\Users\MC44948\Software\springsource\springsource\apache-maven-3.0.4\boot\plexus-classworlds-2.4.jar" org.jvnet.hudson.maven3.agent.Maven3Main C:\Users\MC44948\Software\springsource\springsource\apache-maven-3.0.4 "C:\Program Files (x86)\Jenkins\war\WEB-INF\lib\remoting-2.45.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-1.5.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.5.jar" 53032
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f C:\Users\MC44948\Spring_Workspace\Selenium IDE Recon\pom.xml install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SeleniumTest 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.671s
[INFO] Finished at: Mon Sep 29 11:46:35 BST 2014
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 1]
[JENKINS] Archiving C:\Users\MC44948\Spring_Workspace\Selenium IDE Recon\pom.xml to Test/SeleniumTest/0.0.1-SNAPSHOT/SeleniumTest-0.0.1-SNAPSHOT.pom
[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
channel stopped
Finished: FAILURE
My pom:
<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>Test</groupId>
<artifactId>SeleniumTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SeleniumTest</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>4.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.43.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>2.43.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.6.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
<version>0.16</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
</project>
This seems to be related to Internet connectivity. Did you notice the error: "Unknown host repo.maven.apache.org"?
Try wget http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom and see if you can fetch data.
For more details, you can refer this link.
You can try also this...
My Java project was building successfully when building from command line, but I was getting an error "Unknown host repo.maven.apache.org" when building it with Jenkins.
The problem was is the custom maven settings file which our company was using.
So what you can do is: Under Job configuration, Build section, click "Advanced...".
Set the "Settings file" to "Settings file in filesystem" and give the path to the setting file from your maven installation location. For example
C:\Program Files\apache-maven-3.1.1\conf\settings.xml
Set the "Global Settings file" to "Global settings file on filesystem" and give the path to the "${user.home}/.m2/settings.xml".
You might be behind cooperate proxy (or any other proxy\firewall).
Make sure you can access maven central from the slave you're running your build.
If not - configure your http_proxy and https_proxy on your server.
Related
maven suggests:
Starting with 2.53.0 you need to explicitly include HtmlUnitDriver as a dependency to include it.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>2.20</version>
</dependency>
However, build fails not being able to resolve the dependency.
>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.648 s
[INFO] Finished at: 2016-03-24T14:49:18+02:00
[INFO] Final Memory: 7M/118M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project maven_selenium_project_sample: Could not resolve dependencies for project com.samplecompany:maven_selenium_project_sample:jar:1.0-SNAPSHOT: Could not find artifact org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.20 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project maven_selenium_project_sample: Could not resolve dependencies for project com.samplecompany:maven_selenium_project_sample:jar:1.0-SNAPSHOT: Could not find artifact org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.20 in central (https://repo.maven.apache.org/maven2)
What am I missing?
Thanks
You're missing a 0 in the version like this :
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>2.20.0</version>
</dependency>
As per the error: what you are asking for does not exist at Maven Central. You need either:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>htmlunit-driver</artifactId>
<version>2.20</version>
</dependency>
or:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>2.52.0</version>
</dependency>
Or one of the other possible versions from here.
I am working on a Spring security project in STS. I am trying to build my project but I am getting the following exception.
Error log,
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.288 s
[INFO] Finished at: 2015-11-27T09:41:59+05:30
[INFO] Final Memory: 21M/227M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project spring-data-rest-security: Fatal error compiling: invalid target release: 1.8 -> [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/MojoExecutionException
My pom.xml file is
<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>
<artifactId>spring-data-rest-security</artifactId>
<name>Spring Data REST - Security Example</name>
<parent>
<groupId>org.springframework.data.examples</groupId>
<artifactId>spring-data-rest-examples</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version>
</parent>
<properties>
<spring-security.version>4.0.2.RELEASE</spring-security.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</dependency>
</dependencies>
</project>
I read answers of similar issues but none of them seem to work. Kindly help me out.
Do this in your cmd line C:\mvn>echo %JAVA_HOME% if the output is something like C:\Program Files\Java\jdk1.X... where X is anything but number 8, then you are trying to build it with wrong jdk version.
Install jdk 1.8 and make sure your %JAVA_HOME points to that or drop the target release to 1.X.
That would not help. I had the same issues and my %JAVA_HOME% pointed to jdk1.8.0_45. I also had java version 1.8 language version 8 in IntelliJ "Project Settings >> Build, Execution, Deploy >> Module Compiler Version" and "Project Structure >> Modules >> Source". However this did not fix my issue.
As per this apache resource, it looks like that default source setting after Maven 3.0 is 1.5 that needs a manual override using pom.xml. I explicitly provided source and targer release to 1.8 in my pom.xml and it DID fix my issue.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
I try to build a simple java program: JavaWordCount for spark-1.1.0.
I get this error: Building JavaWordCount 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.279 s
[INFO] Finished at: 2014-10-23T11:28:30-04:00
[INFO] Final Memory: 9M/156M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project JavaWordCount: Could not resolve dependencies for project spark.examples:JavaWordCount:jar:1.0-SNAPSHOT: Failure to find org.apache.spark:spark-assembly_2.10:jar:1.1.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central 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
Here are my dependencies from pom.xml
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-assembly_2.10</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-examples_2.10</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.1.0</version>
</dependency>
It includes spark assembly.
Any ideas would be really appreciated.
Thank you!
The problem is that the dependency:
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-assembly_2.10</artifactId>
<version>1.1.0</version>
</dependency>
is not a jar its a pom file only which means you can't define it like this. You can see it in the error message:
Failure to find org.apache.spark:spark-assembly_2.10:jar:1.1.0
which shows that Maven will try to download a jar file. The means you have to define it like this:
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-assembly_2.10</artifactId>
<version>1.1.0</version>
<type>pom</type>
</dependency>
But i'm not sure if this will solve all problems. You should take a deep look into the documentation if this is the right path.
Update:
You can also use that as BOM via:
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-assembly_2.10</artifactId>
<version>1.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
I'm trying to run java program with maven but when i compiled using the command mvn -U compile
he shows me the following error
[root#onePK-EFT1 tutorials]# mvn -U compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building onePK Java Tutorials 0.6.0.5
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/com/cisco/onep/libonep-core-rel
/0.6.0.5/libonep-core-rel-0.6.0.5.pom
[WARNING] The POM for com.cisco.onep:libonep-core-rel:jar:0.6.0.5 is missing, no
dependency information available
Downloading: http://repo.maven.apache.org/maven2/com/cisco/onep/libonep-
core-rel/0.6.0.5/libonep-core-rel-0.6.0.5.jar
[INFO] ------------------------------------------------------------------------
INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.517s
[INFO] Finished at: Tue Jul 09 07:28:28 PDT 2013
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project java-tutorials: Could not resolve
dependencies for project com.cisco.onep:java-tutorials:jar:0.6.0.5: Could not find
artifact com.cisco.onep:libonep-core-rel:jar:0.6.0.5 in central
(http://repo.maven.apache.org/maven2) -> [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
and this is my 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>com.cisco.onep</groupId>
<artifactId>hello-network-app</artifactId>
<version>0.1-SNAPSHOT</version>
<name>The onePK Hello Network Example Application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<forkMode>always</forkMode>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.cisco.onep</groupId>
<artifactId>libonep-core-rel</artifactId>
<version>0.6.0.5</version>
</dependency>
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.6.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>
<developers>
<developer>
<name>onePK Team</name>
<email>onepk-feedback#cisco.com</email>
<organization>Cisco.com</organization>
</developer>
</developers>
I think it's because he can't find libonep-core-rel.jar which i have it included
please any help
The simple solution is to use the appropriate maven repository for the artifacts com.cisco.onep* which are not located in Maven central.
As an immediate solution, but not a recommendation, you can use system dependencies to resolve artifacts on your local filesystem.
As #khmarbaise implied, try to publish those corporate artifacts to your corporate Maven repository (Nexus, Artifactory, Archiva, etc.), even an FTP/HTTP server would do...
Once you publish those corporate artifacts to your "corporate" repository(hopefully it's already in place), you just need a new repository declaration in your Maven POM.
When I'm running "mvn site" from command line (using far manageR) everything works just excellent, it downloads all the necessary jars to repository and executes tasks.
But when I'm trying to do the same (mvn site) from eclipse using m2eclipse plugin it show me:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jdbc_maven 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # jdbc_maven ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) # jdbc_maven ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to G:\workspace\jdbc_maven\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcRoleDao.java:[8,23] error: package org.apache.log4j does not exist
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcRoleDao.java:[13,16] error: cannot find symbol
[ERROR] symbol: class Logger
location: class JdbcRoleDao
G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\User.java:[5,23] error: package org.apache.log4j does not exist
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\User.java:[28,16] error: cannot find symbol
[ERROR] symbol: class Logger
location: class User
G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcUserDao.java:[13,23] error: package org.apache.log4j does not exist
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcUserDao.java:[19,16] error: cannot find symbol
[ERROR] symbol: class Logger
location: class JdbcUserDao
G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcRoleDao.java:[13,29] error: cannot find symbol
[ERROR] symbol: variable Logger
location: class JdbcRoleDao
G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\User.java:[28,29] error: cannot find symbol
[ERROR] symbol: variable Logger
location: class User
G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcUserDao.java:[19,29] error: cannot find symbol
[INFO] 9 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.387s
[INFO] Finished at: Sat Feb 16 11:05:13 EET 2013
[INFO] Final Memory: 7M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project jdbc_maven: Compilation failure: Compilation failure:
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcRoleDao.java:[8,23] error: package org.apache.log4j does not exist
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcRoleDao.java:[13,16] error: cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class JdbcRoleDao
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\User.java:[5,23] error: package org.apache.log4j does not exist
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\User.java:[28,16] error: cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class User
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcUserDao.java:[13,23] error: package org.apache.log4j does not exist
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcUserDao.java:[19,16] error: cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class JdbcUserDao
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcRoleDao.java:[13,29] error: cannot find symbol
[ERROR] symbol: variable Logger
[ERROR] location: class JdbcRoleDao
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\User.java:[28,29] error: cannot find symbol
[ERROR] symbol: variable Logger
[ERROR] location: class User
[ERROR] G:\workspace\jdbc_maven\src\main\java\com\nixsolutions\JdbcUserDao.java:[19,29] error: cannot find symbol
Here 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>jdbc_maven</groupId>
<artifactId>jdbc_maven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jdbc_maven</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
<version>2.4.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.169</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<exclusions>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<reportPlugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.6</version>
<configuration>
<configLocation>sun_checks.xml</configLocation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.6.1</version>
</plugin>
</reportPlugins>
</configuration>
</plugin>
<!-- JDK 1.7 COMPILER - DON'T TOUCH -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<executable>${env.JAVA_HOME}/bin/javac</executable>
<fork>true</fork>
</configuration>
</plugin>
<!-- JDK 1.7 COMPILER - DON'T TOUCH -->
</plugins>
</build>
</project>
This sometimes happen with m2eclipse , its because as you add new dependencies to the pom.xml , m2e will automatically add it to classpath and this classpath generation has some issue.
well a quick and dirty way to fix would be to
Remove the project from the eclipse
Now navigate to the project folder and delete .settings directory and .classpath file
Import the project into the eclipse as a 'Maven Project'
Do project->clean (also try to refresh the project) in eclipse. When you compile your code from command line it sometimes causes some issue in eclipse and the code has to be recompiled in eclipse
Everyone who's using m2eclipse plugin and strugling some proglems, here are my tips:
1) user your own maven, not build in m2eclipse, you can switch to it in m2eclipse preferences
2) change repository location from the foolish one C:\Users\current_user-m2\repository
to D:\repository or to any other normal path without ~ or any other special liters
3) check everything in console with your own maven before panic. For example my commands like
mvn site
mvn install
mvn tomcat:redeploy
work EXCELLENT from console, but fail from inside eclipse. That means m2eclipse parameters are wrong and you should set your own parameters.
4) don't rely on context commands (right click - run as - maven test / site / build)
create your own command in run as - maven build - in menu choose the correct version of JRE (1.7 in my case) and add any additional parameters don't forget to give this command your name like: "maven tomcat:redeploy JDK 7" - that will give you a good chance to run whatever you want and don't face 90% of m2eclipse problems and bugs.
P.S. I was struggling maven 2 and m2eclipse for more than 20 hours. Hope my tips will be userful for some one.
I had the same problem and I think I have found the solution. The problem is that under run configurations, the maven configuration for your project doesn't have refreshed the new settings made in the overall configuration.
Here is my solution:
in the run button (the one with a green triangle), select run configurations
move into the categories to the "maven build" category and look for the one of your project
checkout that the maven runtime, JRE, and things like that are configured properly: these values aren't refreshed when changed in eclipse
apply changes and run
This solution have worked for me (I have been playing with the value maven runtime, changing between embedded and external and that seemed to be the problem.
same problem when generate docs using m2eclipse, goal javadoc:javadoc or javadoc:jar, meanwhile Project -> Generate Javadoc works fine. It's seem problem in wrong classpath in first case.
Workaround:
1.run Project -> Generate Javadoc with check option "Save the settings ofthe Javadoc export as an antscript"
2. javadoc.xml will be generated
3. run m2eclipse, after failure javadoc.sh, options, packages will be in /site/apidocs/
4. take content of classpath from javadoc.xml and put in classpath in options file
5. run ./javadoc.sh
in pom.xml make sure you have the log4j scope at compile
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<version>2.5</version>
<scope>compile</scope>
</dependency>
It still puts the log4j.jars into the .war.