So I have a maven project that I eventually build into a jar that looks like:
C:\Users\myTest\TESTJAR-1.0-jar-with-dependencies.jar
If I push to cloud foundry using command line it deploys fine:
cf push newProject -p C:\Users\myTest\TESTJAR-1.0-jar-with-dependencies.jar
However, when I trying deploying from Eclipse using the plugin, I get the following
'java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory'
Any help would be appreciated
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>test.myTest</groupId>
<artifactId>TESTJAR</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>test</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- http://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>com.github.lalyos</groupId>
<artifactId>jfiglet</artifactId>
<version>0.0.7</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.8</version>
</dependency>
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>2.3</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<configuration>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.myTest.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
</project>'
Jar-packaged applications can be pushed to Cloud Foundry using Eclipse Cloud Foundry Tools (CFT) in two ways:
Specifying a manifest YAML file at top level in your Eclipse Maven project that points to jar in the file system that you want to push, using the “path" attribute. For example, in a workspace project, MyTestMavenProject, you’d have something like:
MyTestMavenProject/manifest.yml
with the contents of the manifest file
---
applications:
- name: testjarapp
path: C:\Users\myTest\TESTJAR-1.0-jar-with-dependencies.jar
Drag and drop the project containing this manifest file to a Cloud Foundry target in the Eclipse Servers view.
Drag/drop the Maven project without a manifest file, and CFT will automatically package the application prior to pushing to Cloud Foundry. However, this mechanism has some known issues for jar-packaged apps. In some cases, the project needs to be refreshed manually prior to drag/drop:
Refresh the project (typically F5)
Right-click on project: Maven -> Update Project
Drag/drop the Maven project onto the CF target in Servers view again to see if it deploys correctly
There is a bug that is tracking the issue here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=495814
CFT milestones are released roughly every 6 weeks, so the next milestone after Eclipse Neon (4.6) will have various bug fixes and improvements for the deployment of jar-packaged applications.
Related
I have installed jbpm 7.12 server. I created an empty project in MySpace.
I cloned the proposed repo in jbpm-console (MySpace > Project name > Settings and cloned from the suggested URL in Global Settings).
I imported the project in Eclipse but when i do a project update (Maven > Update project), I got the following error
Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project 'approvals'.
Missing parameter for pluginExecutionFilter. groupId, artifactId, versionRange and goals must be specificed, but found: groupId = 'org.kie'
artifactId = 'kie-maven-plugin'
versionRange = '7.12.0.Final'
goals = '[]'
Here my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project 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">
<modelVersion>4.0.0</modelVersion>
<groupId>net.alfasistemi.bpm</groupId>
<artifactId>approvals</artifactId>
<version>1.0.0</version>
<packaging>kjar</packaging>
<name>approvals</name>
<description></description>
<dependencies>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-internal</artifactId>
<version>7.12.0.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.optaplanner</groupId>
<artifactId>optaplanner-core</artifactId>
<version>7.12.0.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.optaplanner</groupId>
<artifactId>optaplanner-persistence-jaxb</artifactId>
<version>7.12.0.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<version>7.12.0.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>7.12.0.Final</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
How can I fix this problem?
I have the same problem in Eclipse. I have reverted back to 7.9.0-Final for just the kjar build plugin: kie-maven-plugin. You can still use 7.12.0-Final in the rest of the dependencies.
Add the following plugin management to the build section in pom.xml
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<versionRange>[7.12.0,)</versionRange>
<goals>
<goal>build</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
I have a spring STS project which depends on two other projects in the same workspace. I have included them in my pom.xml but when I build jar they are excluded from the generated jar.Could you please let me know how to include these two dependent projects in the build.
I have below entries in pom.xml
<dependencies>
<dependency>
<groupId>org.acord.standards.life</groupId>
<artifactId>txlife</artifactId>
<version>2.37.00</version>
</dependency>
<dependency>
<groupId>com.xxx.service.query</groupId>
<artifactId>queryutil</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.acord.standards.life</groupId>
<artifactId>txlife</artifactId>
<version>2.37.00</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.xxx.service.query</groupId>
<artifactId>queryutil</artifactId>
<version>1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<attach>true</attach>
<!-- <includes>
<include>
<groupId>org.acord.standards.life</groupId>
<artifactId>txlife</artifactId>
<version>2.37.00</version>
<classifier>2.37.00</classifier>
</include>
<include>
<groupId>com.xxx.service.query</groupId>
<artifactId>queryutil</artifactId>
<version>1.0</version>
<classifier>1.0</classifier>
</include>
</includes> -->
</configuration>
</plugin>
</plugins>
</build>
I solve this problem following this documentation from Spring.io.
An alternative approach is you run Maven Install for each dependency project and, after it, set them in your pom.xml (in your main project). For example, I have a main spring project called Alna Rest that depends of others particular spring projects how Alna Data and Alna Service, then, in my Alna Rest project my pom.xml has this:
<dependency>
<groupId>com.alna.data</groupId>
<artifactId>alna-data</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>com.alna.service</groupId>
<artifactId>alna-service</artifactId>
<version>0.0.1</version>
</dependency>
After it I can run Maven Install in my Alna Rest project that the Spring Boot Maven Plugin build an executable jar with all projects dependencies.
Well, this works for me. But I don't know if it is the better approach for build a project that requires many othes spring boot projects. Then I recommend you search more about this.
I have a Scala application that I'm trying to package as a .jar file using Maven. There is an application.conf file that I'm trying to package into the jar as a resource. However, when I use the resources plugin, either automatically by putting the resources in src/main/resources, or explicitly by adding it to pom.xml from some other folder, Maven then stops compiling and packaging the .class files in the jar.
So long as I don't use the resources plugin, everything works 100%. Maven runs the Scala compiler, puts the .class files into the jar, and after manually adding my resources via 7zip the program executes just fine.
A few additional details:
I'm using the scala-maven-plugin with the Artima Supersafe compiler plugin
I'm also using the maven-shade-plugin to generate a fat jar, concatenate akka reference.conf files, and generate the manifest. This still works when using the resources plugin, its just my .class files are missing. I've tried running without this plugin but the results are the exact same.
I am manually specifying the sourceDirectory as src/main/scala
When not using the resource plugin, the Scala compiles and the console output displays [INFO] --- scala-maven-plugin:3.2.0:compile (default) # batchmanager --- followed by compiler warnings, etc. However, when using the resource plugin it instead always insists: [INFO] Nothing to compile - all classes are up to date
The application.conf file does actually appear in the jar correctly when using the resource plugin
I'm running Maven through Eclipse, not the CLI
I have a feeling there is something about the resource plugin that I do not understand. Any help would be much appreciated.
The full pom.xml (removing the resources definition is the only difference between the working and non-working versions of the 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.digitalalbatross</groupId>
<artifactId>batchmanager</artifactId>
<version>0.0.1</version>
<name>${project.artifactId}</name>
<inceptionYear>2017</inceptionYear>
<licenses>
<license>
<name>My License</name>
<url>http://....</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.version>2.12.2</scala.version>
<scala.compat.version>2.12</scala.compat.version>
</properties>
<repositories>
<repository>
<id>artima</id>
<name>Artima Maven Repository</name>
<url>http://repo.artima.com/releases</url>
</repository>
</repositories>
<dependencies>
<!-- Test -->
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http_2.12</artifactId>
<version>10.0.7</version>
<exclusions>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.iq80.leveldb</groupId>
<artifactId>leveldb</artifactId>
<version>0.9</version>
</dependency>
<dependency>
<groupId>org.fusesource.leveldbjni</groupId>
<artifactId>leveldbjni-all</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.12</artifactId>
<version>2.5.1</version>
<exclusions>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-persistence_2.12</artifactId>
<version>2.5.1</version>
<exclusions>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream_2.12</artifactId>
<version>2.5.1</version>
<exclusions>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http-spray-json_2.12</artifactId>
<version>10.0.6</version>
<exclusions>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.12</artifactId>
<version>3.0.3</version>
<exclusions>
<exclusion>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.12.2</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<resources>
<resource>
<directory>res</directory>
<includes>
<include>application.conf</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<!-- see http://davidb.github.com/scala-maven-plugin -->
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<configuration>
<compilerPlugins>
<compilerPlugin>
<groupId>com.artima.supersafe</groupId>
<artifactId>supersafe_${scala.version}</artifactId>
<version>1.1.2</version>
</compilerPlugin>
</compilerPlugins>
<args>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<useFile>false</useFile>
<disableXmlReport>true</disableXmlReport>
<!-- If you have classpath issue like NoDefClassError,... -->
<!-- useManifestOnlyJar>false</useManifestOnlyJar -->
<includes>
<include>**/*Test.*</include>
<include>**/*Suite.*</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>allinone</shadedClassifierName>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>reference.conf</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.digitalalbatross.batchmanager.Boot</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<description>Batch Manager for IMAX</description>
<organization>
<name>Digital Albatross Design and Consulting</name>
<url>digitalalbatross.com</url>
</organization>
</project>
I managed to solve my issue in the course of solving another. My eclipse workbench kept crashing on boot, so I deleted the .plugins folder to try and solve the issue. Not only did this fix my eclipse setup, but Maven decided to cooperate and started to actually include both resource and class files in the jar. After some confusion over which of the generated jar files actually had a working manifest, I've verified that it is now working as expected.
To summarize, it was most likely some bizarre bug caused by something in my .plugins folder for eclipse. Deleting that folder and reconfiguring my setup fixed the issue.
I am trying to run cucumber tests in eclipse using maven build as run configuration.
When i run the configuration, build is getting success but browser does not invoke. Hence the test is not running.
Tests are getting skipped, giving an info "Nothing to compile - all classes are up to date".
I am able to run the same test successfully by running the feature file as cucumber feature.
Please suggest me why tests are getting skipped. Also let me know the steps for running the cucumber test as maven build.
Below is the pom.xml that i am using.
Also i am using vm arguments as "-Dcucumber.Options=--format html:target/cucumber-html-report --tags #Runme"
<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>Maven.Project</groupId>
<artifactId>testMaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Maven.Project-v1-testMaven</name>
<properties>
<corporate.test.url>http://google.com</corporate.test.url>
<corporate.test.browser>Firefox</corporate.test.browser>
<corporate.selenium.url>http://localhost:8888/wd/hub</corporate.selenium.url>
</properties>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.1.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.1.8</version>
<scope>test</scope>
</dependency>
<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.42.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>test</id>
<properties>
<corporate.test.url>http://acc-about.hm.com</corporate.test.url>
<corporate.test.browser>Firefox</corporate.test.browser>
<corporate.selenium.url>http://localhost:8888/wd/hub</corporate.selenium.url>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
</project>
Please remove the skiptests tag in your maven - surefire plugin...
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
EDIT:
please add the following lines in configuration
<suiteXmlFiles>
<suiteXmlFile>${basedir}${suiteFile}</suiteXmlFile>
</suiteXmlFiles>
<reportsDirectory>./test-output/archive/${timestamp}</reportsDirectory>
In here suiteXmlFile points to your xml file you are trying to run and reportsDirectory points to your output folder. In command line or if using eclipse in goal provide clean test -DsuiteFile=
Hope tthis would help.
I am using the Maven Tomcat plugin to test a Maven webservice project using Hibernate.
My POM looks like this:
<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.honeywell.gt</groupId>
<artifactId>WSOCCMeoReports</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Simple CXF project using spring configuration</name>
<description>Simple CXF project using spring configuration</description>
<properties>
<shiro.version>1.2.1</shiro.version>
<spring.version>3.1.2.RELEASE</spring.version>
<cxf.version>2.6.1</cxf.version>
<hibernate.version>3.6.5.Final</hibernate.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<!--
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>${hibernate.version}</version>
</dependency> -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>com.sybase.jdbc</groupId>
<artifactId>SybDriver</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<!-- mvn clean install tomcat:run-war to deploy
Look for "Running war on http://xxx" and
"Setting the server's publish address to be /yyy"
in console output; WSDL browser address will be
concatenation of the two: http://xxx/yyy?wsdl
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<executions>
<execution>
<id>start-tomcat</id>
<goals>
<goal>run-war</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<port>${test.server.port}</port>
<path>/webservice</path>
<fork>true</fork>
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
The Debug goals are tomcat:run-war
After hitting a break point in the service I cannot step into third party dependencies such as Hibernate. However, if I run a Unit test from the same Maven web service project, I can step into Hibernate.
EDIT 1:
I ran into this and got some ideas about attaching source. Matter of fact, I am trying to debug Hibernate, so I edited source lookup and added paths to the following external archives in my .m2 repository:
hibernate-entitymanager-3.6.5.Final
hibernate-core-3.6.5.Final.
Saved changes and Eclipse still cannot find source to step into. Anyone out there?
Problem appears to be a know issue with Maven Plugin for Eclipse as indicated here.
This post was helpful but I found out that for hibernate 3.6.5, I had to add hibernate-core-3.6.5.Final-sources.jar to source lookup path instead of hibernate-core-3.6.5.Final.jar.