I have followed the following link to create a maven project Create Project. Like creating a simple gwt project and then configure for maven. Till here it goes simple without any problem.Like we are couchdb as our database, I have been trying to add couchdb dependency.
Problem 1: Tried out many ways but unable to add couchdb 4j dependency.
Error: Missing artifact com.google.code:couchdb4j:jar:0.1.2
Now, want the solution for this.
Query: Is there any other way to work with maven with GWT.
EDIT 1
I got a pom.xml from a link where they have couchdb4j in it, but still my basics function of create document(), getDocument() are not been received. The couchdb4j is not added to maven dependencies as seen in build path.
Is there some difference with client and server side use of maven dependencies?
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>couchdb4j</groupId>
<artifactId>couchdb4j</artifactId>
<name>CouchDB4J</name>
<version>0.3.0-i386-1</version>
<url>http://code.google.com/p/couchdb4j/</url>
<build>
<sourceDirectory>src/java</sourceDirectory>
<testSourceDirectory>src/test</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>logkit</groupId>
<artifactId>logkit</artifactId>
</exclusion>
<exclusion>
<groupId>avalon-framework</groupId>
<artifactId>avalon-framework</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.3</version>
<scope>compile</scope>
<classifier>jdk15</classifier>
<exclusions>
<exclusion>
<groupId>org.jruby</groupId>
<artifactId>jruby</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.ezmorph</groupId>
<artifactId>ezmorph</artifactId>
<version>1.0.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.0-beta2</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>codehaus.snapshots</id>
<name>Codehaus Maven Snapshot Repository</name>
<url>http://snapshots.repository.codehaus.org</url>
<snapshots>
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>nexus</id>
<name>My Nexus</name>
<url>http://localhost:8081/nexus/content/repositories/thirdparty/</url>
</repository>
</distributionManagement>
</project>
For the time being i added it as it is.
Still unaware with the problem that why its not adding the dependencies?
What exactly I have to do for adding couchdb4j jar from dependencies?
probably a temporary fix, add this repo to your pom
<repositories>
<repository>
<id>repo-wso2</id>
<url>http://maven.wso2.org/nexus/content/repositories/abdera.couchdb.temporary</url>
</repository>
</repositories>
Related
I'm trying to resurrect an old project. I wanted to use Maven to manage dependencies/build/etc., and I got pretty far, but now I'm running into an error that I can't seem to resolve, and that I can't seem to find anything about:
Failed to execute goal on project scanit: Could not resolve dependencies for project net.cbojar:scanit:jar:0.2: Could not find artifact javax.persistence:ejb:jar:3.0-public-draft-20060327 in maven2 (http://repo1.maven.org/maven2/)
It wants to download a ejb-3.0-public-draft-20060327.jar file, but that file does not exist in the repo.
I'm relatively new to maven, and I wanted to use this as practice, but I have now painted myself into a corner. Below 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>net.cbojar</groupId>
<artifactId>scanit</artifactId>
<version>1.0</version>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<testSourceDirectory>${basedir}/test</testSourceDirectory>
<outputDirectory>${basedir}/bin/classes</outputDirectory>
<testOutputDirectory>${basedir}/bin/test</testOutputDirectory>
<directory>${basedir}/bin</directory>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>net.cbojar.scanit.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>maven2</id>
<name>Central Maven Repository</name>
<url>http://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
<!--These are needed for Swing/Netbeans -->
<repository>
<id>maven2-repository.netbeans.maven2</id>
<name>Netbeans Maven Repository</name>
<url>http://bits.netbeans.org/maven2/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<!-- TODO: Update to JUnit 4 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.netbeans.external</groupId>
<artifactId>AbsoluteLayout</artifactId>
<version>RELEASE701</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.6</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm-attrs</artifactId>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.1_3</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.2.2.0</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.23</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.1.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.1beta9</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.1.0.GA</version>
</dependency>
<dependency>
<groupId>hibernate</groupId>
<artifactId>hibernate-tools</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>net.sf.jtidy</groupId>
<artifactId>jtidy</artifactId>
<version>r938</version>
</dependency>
<dependency>
<groupId>org.netbeans</groupId>
<artifactId>lib</artifactId>
<version>3.6</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.swinglabs</groupId>
<artifactId>swing-layout</artifactId>
<version>1.0.3</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
</project>
Given that you are converting to Maven an existing project, you should respect the original dependencies. That means adding as a Maven dependency the exact same version of the original dependencies and excluding unused transitive dependency (since the original project doesn't need it and it works correctly then we can safely exclude them from the pom).
It turns out that javax.persistence:ejb:jar:3.0-public-draft-20060327 is a transitive dependency of org.hibernate:hibernate-annotations:3.1beta9. If the original project doesn't need it, you can exclude it from the pom like this:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.1beta9</version>
<exclusions>
<exclusion>
<groupId>javax.persistence</groupId>
<artifactId>ejb</artifactId>
<exclusion>
</exclusions>
</dependency>
Remove your
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.1beta9</version>
</dependency>
And use:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
That is the dependency causing you that problem. It is from 2006. I also recommend you to update your dependencies version to the most up to date.
EDIT
As such an upgrade may break your code, and without further details, you should probably stick with a version closer to the one you are trying to use.
Check here for all hibernate-annotations versions available in maven repo.
You maybe need this dependecy declaration inside your project pom.xml:
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>ejb-3.0-public-draft</artifactId>
<version>20050627</version>
<type>pom</type>
</dependency>
My project team is using maven build. We have a package name as **/**/**/RCS under which all the classes are getting generated. But the jar does not contain these classes for some reason. Is there a way to include these classes into the RCS.jar?
We are using maven build to compile all the modules in the application. There is no problem with other packages having a similar format.
Please suggest where the issue can be.
Thanks in advance!!!
This is the pom.xml for the package. Have removed certain dependencies.
<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>XX.4-1.Components.Oracle</groupId>
<artifactId>RCS</artifactId>
<version>4.1</version>
<packaging>jar</packaging>
<name>RCS</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<archDeliveryPath>/home/user/BuildWorkspace/Product_Deployment/Dependent_Jars</archDeliveryPath>
</properties>
<dependencies><dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>Oracle</groupId>
<artifactId>ojdbc5</artifactId>
<version>1.0</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>Oracle</groupId>
<artifactId>j2ee</artifactId>
<version>1.0</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>Oracle</groupId>
<artifactId>ErrorMessages</artifactId>
<version>1.0</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ThirdpartyLicensedDependencyPOM</groupId>
<artifactId>License-Base</artifactId>
<version>1.0</version>
<type>pom</type>
</dependency>
<dependency><groupId>com.sum</groupId><artifactId>rt</artifactId><version>0.1</version><scope>system</scope><systemPath>${java.home}/lib/rt.jar</systemPath></dependency>
<dependency><groupId>com.sun</groupId><artifactId>tools</artifactId><version>0.1</version><scope>system</scope><systemPath>${java.home}/../lib/tools.jar</systemPath></dependency>
<dependency>
<groupId>XX.4-1.Components.Oracle</groupId>
<artifactId>XX</artifactId>
<version>(,4.1]</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>XX.4-1.Components.Oracle</groupId>
<artifactId>XX</artifactId>
<version>(,4.1]</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ARCHPOM</groupId>
<artifactId>XX</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${archDeliveryPath}/XX.jar</systemPath>
</dependency>
<dependency>
<groupId>ARCHPOM</groupId>
<artifactId>CommonFunctionality</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${archDeliveryPath}/CommonFunctionality.jar</systemPath>
</dependency>
</dependencies>
<repositories>
<repository>
<id>id1</id>
<name>Artifactory</name>
<url>http://URL</url>
</repository>
<repository>
<id>Artifactory</id>
<name>Artifactory</name>
<url>http://URL</url>
</repository>
<repository>
<id>Artifactory</id>
<name>Artifactory-releases</name>
<url>http://URL</url>
</repository>
<repository>
<id>Licensed Artifactory</id>
<name>Artifactory-releases</name>
<url>http://URL</url>
</repository>
<repository>
<id>id4</id>
<name>Artifactory</name>
<url>http://URL</url>
</repository>
<repository>
<id>id3</id>
<name>Artifactory</name>
<url>http://URL</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>id2</id>
<name>Artifactory</name>
<url>http://URL</url>
</repository>
</distributionManagement>
</project>
the problem is resolved. Changed the default excludes in plexus-utils-2.0.5.jar/org/codehaus/plexus/util/AbstractScanner.java which was excluding **/RCS & **/RCS/**. Commented the RCS line and voila, it worked.
Try adding this to your pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<includes>
<include>**/RCS/*</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
I have an IntelliJ Idea Maven project which built successfully up to recently to a <directory> specified within the <build> of pom file. Given below is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>mservice</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>mservice Jersey Webapp</name>
<build>
<finalName>ROOT</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
<directory>C:/MService</directory>
</build>
<dependencies>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>${jersey-version}</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>${jersey-version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Jersey + Spring -->
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-spring</artifactId>
<version>${jersey-version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.29</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.2.1.Final</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- slf4j-log4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
<properties>
<jersey-version>1.8</jersey-version>
<spring.version>3.2.8.RELEASE</spring.version>
</properties>
<repositories>
<repository>
<id>m2.java.net</id>
<name>Java.net Maven 2 Repository</name>
<url>http://download.java.net/maven/2</url>
<layout>default</layout>
</repository>
<repository>
<id>JBoss repository</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>m2.java.net</id>
<name>Java.net Maven 2 Repository</name>
<url>http://download.java.net/maven/2</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
</project>
Project is located within D:/Projects/MService.
But since recently, compilation fails with FileNotFoundException and this message.
Information:Internal caches are corrupted or have outdated format,
forcing project rebuild: java.io.FileNotFoundException:
D:\Projects\MService\C:\MService\classes\com\example\mservice\data\data.txt
(The filename, directory name, or volume label syntax is incorrect)
As given in the message a path confusion happens somewhere and I can't figure it out. If I remove the <directory> within <build> everything works fine.
com.example.mservice.data is a package within the resources folder. All my google searches have been in vain. Is this a problem with IntelliJ or is it a problem with my pom.xml? Does anyone have an idea on how to fix this?
I converted my eclipse project to maven by creating a pom.xml file. I built the .war file by maven build command by specifying the goal
clean compile install
and it build successfully. Now when I am running it on appache tomcate it throws no class found exceptions as I check .war/WEB-INF/classes folder is empty. Why classes folder is empty? Is this the reason why .war is not running on apache.
Please let me know if you need any further details
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>mycom</groupId>
<artifactId>myproject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>com</name>
<description>Maven project</description>
<properties>
<spring.version>3.2.0.RELEASE</spring.version>
</properties>
<repositories>
<repository>
<id>terracotta-repository</id>
<url>http://repo.terracotta.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>rome</groupId>
<artifactId>rome</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.1.0</version>
</dependency>
<!-- mybaties -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.0</version>
</dependency>
<!--Joda time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time-jsptags</artifactId>
<version>1.1.1</version>
</dependency>
<!--java image scaling -->
<dependency>
<groupId>com.mortennobel</groupId>
<artifactId>java-image-scaling</artifactId>
<version>0.8.5</version>
</dependency>
<!-- mysql connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.24</version>
</dependency>
<!--log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>Codehaus Snapshots</id>
<url>http://snapshots.repository.codehaus.org/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<build>
<finalName>jemm.organise.net</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://127.0.0.1:8080/manager/text</url>
<server>TomcatServer</server>
<path>/myproject</path>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<webXml>WebContent\WEB-INF\web.xml</webXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<includes>
<include>**/*Tests.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
It is very hard to know the exact problem with so few details, however my guess would be that you have the wrong directory structure. Your code must be in the src/main/java/packagepath directory otherwise maven will not be able to find it and will create an empty jar/war.
As an additional note, the compile phase is included when you invoke the install phase so you do not need to explicitly call it.
This is my first time using Maven and for some reason on my machine I am unable to get two of the hibernate dependencies that I need. My Pom.xml file is below:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.aramburu</groupId>
<artifactId>depcheck</artifactId>
<name>depcheck</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.6</java-version>
<org.springframework-version>3.1.0.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.9</org.aspectj-version>
<org.slf4j-version>1.5.10</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- #Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.8.Final</version><!--$NO-MVN-MAN-VER$-->
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.8.Final</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
For some reason org.hibernate hibernate-entitymanager
cannot be found. The maven setup I am using is the default that comes with springsource tool suite. I made no modifications to the version of maven they gave me. I am trying to build this on 64 bit windows machine with jdk 7 installed.
I have looked into the other solutions like updating depdencies and configuration in the menu that pops up when you right click on a project and go to maven.
Some people have said I need to enable the dependencies but there is no menu to do so on the right and I am able to download things like the hibernate core and have the dependencies be properly resolved. Just having issues with that specific dependency.
Do I need to add repositories or anything of that nature to the original settings.xml file provided with the installation of maven in SpringSource Tool Suite?
This dependency seems to be not found on your default repository maven is looking into, It exist at jboss's maven repository
So to enable maven to look for that repository too add following into your pom.xml
<project ...>
<repositories>
<repository>
<id>JBoss repository</id>
<url>http://snapshots.jboss.org/maven2</url>
</repository>
</repositories>
</project>
And try mvn clean install
If you are running Maven from console, you need to do it in a directory with your pom.xml file.
For Hibernate stuff, you possibly need to declare the following in your pom.xml (or settings.xml):
<repository>
<id>repository.jboss.org</id>
<name>JBoss Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
</repository>
use this
central Maven Repository Switchboard default http://repo1.maven.org/maven2 false com.springsource.repository.libraries.release SpringSource Enterprise Bundle Repository - SpringSource Library Releases http://repository.springsource.com/maven/libraries/release