trg-search & pom.xml

174 views
Skip to first unread message

abki

unread,
Apr 16, 2010, 9:29:49 AM4/16/10
to java-generic-dao
Maven try to buiild trg-search with javax.persistence 1.0 by default
since my project is JPA 2.0 compliant the build works fine but
execution fails because of this dependency against the deprecated API.

<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

Is that a bug of the pom.xml of trg-search or is it my poorly
configured maven project ? 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dil</groupId>
<artifactId>Polymarmots</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Polymarmots</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>JBOSS</id>
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2/</url>
</repository>
<repository>
<id>trg-dao-repo</id>
<name>Repository for The Revere Group's Hibernate Generic
DAO framework</name>
<url>http://hibernate-generic-dao.googlecode.com/svn/trunk/
maven-repo/</url>
</repository>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>

</repositories>
<dependencies>
<dependency>
<groupId>javax.sql</groupId>
<artifactId>jdbc-stdext</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<!-- This first dependency includes all the JPA
implementations for the DAOs -->
<dependency>
<groupId>com.trg</groupId>
<artifactId>trg-dao</artifactId>
<version>0.5.1</version> <!-- or whatever the latest
version is -->
</dependency>
<!-- This second one includes the Hibernate Entity Manager
plugin for the framework -->
<dependency>
<groupId>com.trg</groupId>
<artifactId>trg-search-jpa-hibernate</artifactId>
<version>0.5.1</version> <!-- or whatever the latest
version is -->
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>3.0.10</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.0-Final</version>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.5.11</version>

</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>config/sun_checks.xml</
configLocation>
</configuration>
</plugin>
</plugins>
</reporting>
</project>

--
You received this message because you are subscribed to the Google Groups "java-generic-dao" group.
To post to this group, send email to java-gen...@googlegroups.com.
To unsubscribe from this group, send email to java-generic-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/java-generic-dao?hl=en.

David W

unread,
Apr 16, 2010, 11:52:23 AM4/16/10
to java-generic-dao
Hmm. Yeah, the framework does expect version 1.0. It may still work
with 2.0 though. I think Maven provides a way for you to overwrite the
version of a dependency, but I'm afraid the framework may fail at
runtime if JPA 2.0 is used. You can give it a try. You'll have to
research how to do it. Let me know how it goes.

Anyway, sounds like I should upgrade to JPA 2.0 in future versions of
the framework.

David W.

On Apr 16, 8:29 am, abki <amirouche.boube...@gmail.com> wrote:
> Maven try to buiild trg-search with javax.persistence 1.0 by default
> since my project is JPA 2.0 compliant the build works fine but
> execution fails because of this dependency against the deprecated API.
>
>                 <dependency>
>                         <groupId>javax.persistence</groupId>
>                         <artifactId>persistence-api</artifactId>
>                         <version>1.0</version>
>                         <type>jar</type>
>                         <scope>compile</scope>
>                 </dependency>
>
> Is that a bug of the pom.xml of trg-search or is it my poorly
> configured maven project ? 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.0http://maven.apache.org/maven-v4_0_0.xsd">

Jeff Jensen

unread,
Apr 16, 2010, 7:25:53 PM4/16/10
to java-gen...@googlegroups.com
Abki, you should add an <excludes> element for it to the dep.

David, you should add a <scope>provided</provided> to the dep to prevent
this transient leakage.

abki

unread,
Apr 17, 2010, 8:38:32 AM4/17/10
to java-generic-dao
I did not see Jeff's post so I didn't went with <excludes> but with
<exclusions> but thing went pretty nasty and I finally went on listing
every dependecy I needed and removing trg from de repositories. At
least it works, but "kills" a bit maven as I need to manually add the
jars.

<dependency>
<groupId>com.trg</groupId>
<artifactId>trg-dao</artifactId>
<version>0.5.1</version>
<exclusions>
<exclusion>
<groupId>persistence-api</groupId>
<artifactId>javax.persistence</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.trg</groupId>
<artifactId>trg-search-hibernate</artifactId>
<version>0.5.1</version>
<exclusions>
<exclusion>
<groupId>persistence-api</groupId>
<artifactId>javax.persistence</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.trg</groupId>
<artifactId>trg-search</artifactId>
<version>0.5.1</version>
<exclusions>
<exclusion>
<groupId>persistence-api</groupId>
<artifactId>javax.persistence</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.trg</groupId>
<artifactId>trg-search-jpa-hibernate</artifactId>
<version>0.5.1</version>
<exclusions>
<exclusion>
<groupId>persistence-api</groupId>
<artifactId>javax.persistence</artifactId>
</exclusion>
</exclusions>
</dependency>

You will find the complete pom.xml hibernate 3.5 + JPA 2.0 + java-
generic-dao here : http://java.pastebin.ca/1864786

I will digg another solution later, but now I have more important
matters to deal with.

Thanks for your time.

Abki.
Reply all
Reply to author
Forward
0 new messages