New Maven Dependencies for latest 0.93 SNAPSHOT?

35 views
Skip to first unread message

Mike

unread,
Jun 9, 2010, 5:18:43 PM6/9/10
to Morphia
Are the maven dependencies set correctly on the latest snapshot? I'm
getting a compile error in my maven project...

could not parse error message: com/google/code/morphia/mapping/lazy/
CGLibLazyProxyFactory.java(com/google/code/morphia/mapping/
lazy:CGLibLazyProxyFactory.java):17: package
com.thoughtworks.proxy.factory does not exist
import com.thoughtworks.proxy.factory.CglibProxyFactory;

Thanks.

Scott Hernandez

unread,
Jun 9, 2010, 6:02:18 PM6/9/10
to mor...@googlegroups.com
I'm confused. Are you building from source or using the jars?

This seems like a compiler error, but not in your project.

The latest pom is here:
http://code.google.com/p/morphia/source/browse/mavenrepo/com/google/code/morphia/morphia/0.93-SNAPSHOT/morphia-0.93-20100609.210914-27.pom

The snapshot is pointing to it:
http://code.google.com/p/morphia/source/browse/mavenrepo/com/google/code/morphia/morphia/0.93-SNAPSHOT/maven-metadata.xml

It is clear from the pom that the deps are there.
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>[2.1_3,)</version>
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.thoughtworks.proxytoys</groupId>
<artifactId>proxytoys</artifactId>
<version>1.0</version>
<type>jar</type>
<optional>true</optional>
</dependency>

You will note that these are optional, but that will only affect your
project if you want to use those features; in which case you need to
add them to your project (so the libraries are added to your run-time
class path). See
http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html


I will push up another snapshot to the repo. just in case, but there
were no errors on that last one, and the commit logs looked good.

Mike

unread,
Jun 10, 2010, 10:51:14 AM6/10/10
to Morphia
Thanks, Scott.

So, I'm using the jars and have maven set up as follows:

MyProject -> Morphia (0.93-SNAPSHOT) -> Optional Jars

It cannot build my project because it cannot find those optional jars.
I'm not too familiar with maven optional jars, as I continue studying
the link you sent me, I'd appreciate any advice.

-Mike

On Jun 9, 6:02 pm, Scott Hernandez <scotthernan...@gmail.com> wrote:
> I'm confused. Are you building from source or using the jars?
>
> This seems like a compiler error, but not in your project.
>
> The latest pom is here:http://code.google.com/p/morphia/source/browse/mavenrepo/com/google/c...
>
> The snapshot is pointing to it:http://code.google.com/p/morphia/source/browse/mavenrepo/com/google/c...
>
> It is clear from the pom that the deps are there.
>                 <dependency>
>                         <groupId>cglib</groupId>
>                         <artifactId>cglib-nodep</artifactId>
>                         <version>[2.1_3,)</version>
>                         <type>jar</type>
>                         <optional>true</optional>
>                 </dependency>
>                 <dependency>
>                     <groupId>com.thoughtworks.proxytoys</groupId>
>                     <artifactId>proxytoys</artifactId>
>                     <version>1.0</version>
>                         <type>jar</type>
>                         <optional>true</optional>
>                 </dependency>
>
> You will note that these are optional, but that will only affect your
> project if you want to use those features; in which case you need to
> add them to your project (so the libraries are added to your run-time
> class path). Seehttp://maven.apache.org/guides/introduction/introduction-to-optional-...

Mike

unread,
Jun 10, 2010, 10:57:36 AM6/10/10
to Morphia
It's probably worth adding that when I add:
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>[2.1_3,)</version>
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.thoughtworks.proxytoys</groupId>
<artifactId>proxytoys</artifactId>
<version>1.0</version>
<type>jar</type>
<optional>true</optional>
</dependency>

to "MyProject" which references morphia, it builds fine, but based on
my understanding, this defeats the purpose of the optional jars in the
first place. Hmmm...Perhaps if "MyProject" is referencing optional
jars via some import in morphia, it triggers this non-optional
dependency and requires it during compile time?

Oh well, I'm building again.

Scott Hernandez

unread,
Jun 10, 2010, 10:57:19 AM6/10/10
to mor...@googlegroups.com
Just add those dependencies to your pom and make them non-optional.
Your project will then include them. I think it is that simple.

I don't use maven (for project I start, and can keep away from maven);
I would suggest not using it. It is broken by design.

Scott Hernandez

unread,
Jun 10, 2010, 11:10:15 AM6/10/10
to mor...@googlegroups.com
On Thu, Jun 10, 2010 at 7:57 AM, Mike <michae...@gmail.com> wrote:
> It's probably worth adding that when I add:
>                <dependency>
>                        <groupId>cglib</groupId>
>                        <artifactId>cglib-nodep</artifactId>
>                        <version>[2.1_3,)</version>
>                        <type>jar</type>
>                        <optional>true</optional>
>                </dependency>
>                <dependency>
>                    <groupId>com.thoughtworks.proxytoys</groupId>
>                    <artifactId>proxytoys</artifactId>
>                    <version>1.0</version>
>                        <type>jar</type>
>                        <optional>true</optional>
>                </dependency>
>
> to "MyProject" which references morphia, it builds fine, but based on
> my understanding, this defeats the purpose of the optional jars in the
> first place. Hmmm...Perhaps if "MyProject" is referencing optional
> jars via some import in morphia, it triggers this non-optional
> dependency and requires it during compile time?

No, the optional part only applied to projects that include you as a
dep. The docs talk about this rather explicitly. That section above,
with or without optional means the same thing for your project
dependencies and classpath.

Uwe Schäfer

unread,
Jun 10, 2010, 11:44:38 AM6/10/10
to mor...@googlegroups.com
Scott Hernandez schrieb:

> I don't use maven (for project I start, and can keep away from maven);
> I would suggest not using it. It is broken by design.

i reaaaaally dont want to enter this discussion, but i cannot stay away
from - just for the record - objecting here ;)

it might be not fit for absolutely everthing but it saves time like hell
even in smaller teams.

cu uwe

:)

Rajesh Koilpillai

unread,
Jun 11, 2010, 7:35:37 AM6/11/10
to mor...@googlegroups.com
+1 for maven

2010/6/10 Uwe Schäfer <u...@thomas-daily.de>



--
Thanks,
- Rajesh Koilpillai
Reply all
Reply to author
Forward
0 new messages