On Apr 16, 2008, at 12:11 PM, Gary McGath wrote:
> It's embarrassing that I should have to ask how to make a simple  
> change
> to a makefile, but I'm finding Maven to be one of the most  
> bewildering,
> overly complex pieces of software I've run into.

Well, it is different than most "Make" or "Ant" tools out there  
because it is both a build tool and a distribution management tool,  
much like Yum/RPM, Gentoo/Emerge, Perl/CPAN, or R/CRAN.  If you can  
wrap your head around that, it will save you some frustration.  It is  
just a different model.

> I've added some Java code within dspace-api, in our own package.

We've moved away from suggesting that you add code to dspace-api or  
alter code there, this is one of the reasons we aopted MAven, was to  
modularize the codebase and free the end user from having to alter  
this code directly and worry about "merging changes" all the time.

> Maven sees that, with no problem, and tries to compile it. But for  
> it to
> compile successfully, it needs to use a couple of .jar files which we
> have previously developed here.

Tell me a little about those tools you've developed? How are they  
managed, is there a release cycle... I can direct you on how to  
install them into Maven and adjust the build dependencies so they are  
included.

> I've put the jars into
> (dspace/target/dspace-1.5.0-build.dir/lib/),

thats only for CLI tools and is the product of the build, not the  
location that dependencies are gotten from in Maven, to add  
dependencies to your Maven build, you can either create new Maven  
projects for them and include those into your build, or install the  
jars into your local maven repository by hand and then just add them  
as dependencies in the build.

> but that's not enough to
> get them picked up. I'm guessing that I have to add <dependency>  
> tags to
> pom.xml, but can't find any documentation which I can comprehend.

Yes, this is the "end" of the process I talk about above, the  
beginning is getting your dependencies published locally.  You'll  
probibly make up your own groupId, artifactId and Version for these,  
if you do so, then I will show you how to add them. Basically its

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> - 
DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=jar

and then in your pom where its required add:

<dependency>
        <artifactId>[artifact-id]</artifactId>
        <groupId>[group-id]</groupId>
        <version>[version]</version>
</dependency>

> The pom reference page (http://maven.apache.org/pom.html) talks about
> the groupId and artifactId, but neither one of these seems to be the
> name or path of the jar file. The packaging tag tells Maven that it  
> _is_
> a jar file, but apparently nothing more specific than that. Could
> someone point me at a simple explanation of how to get this to work?

see for more info

http://maven.apache.org/general.html#importing-jars

There is documentation, but its distributed in a number of places on  
the Maven site. Historically folks have complained about Maven  
documentation, mostly because, while there is allot there, its a  
little painful to navigate, I find it best to use google to query the  
maven.apache.org site directly to find the topic I'm interested in...  
sad but true.

-Mark





~~~~~~~~~~~~~
Mark R. Diggory - DSpace Developer and Systems Manager
MIT Libraries, Systems and Technology Services
Massachusetts Institute of Technology






-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to