Re: [newby] how to include/package private libs/*.jar
Hi Nick, On 24/04/2008, at 6:50 PM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: It would be something like: org.apache.maven.plugins maven-dependency-plugin 2.0 list-deps generate-resources list foo.txt Nice. Thanks for that. And/Or I suppose I could use antrun to transform the output as needed. with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [newby] how to include/package private libs/*.jar
It would be something like: org.apache.maven.plugins maven-dependency-plugin 2.0 list-deps generate-resources list foo.txt Hth, Nick S. -Original Message- From: Lachlan Deck [mailto:[EMAIL PROTECTED] Sent: Thu 4/24/2008 04:40 To: Maven Users List Subject: Re: [newby] how to include/package private libs/*.jar Hi Joshua, On 23/04/2008, at 11:23 PM, Joshua ChaitinPollak wrote: > On Apr 23, 2008, at 1:05 AM, Lachlan Deck wrote: >>>> - append to the text file a list of the jars bundled (prefixing >>>> each with a custom path). >>> >>> That's a tricky one. I'd have to say start with the dependency or >>> assembly plugin and see if they can do what you need. I know one >>> of the plugins can put the jars on your classpath in the Manifest, >>> but we don't use the manifest, so I have no experience with it. >> >> Right. This is the bit I'm stuck with... > > Well, I'm not sure if this is helpful or not, but you can do this: > > mvn -DoutputFile=foo.txt dependency:list > > which will put your dependencies in a file called foo.txt. You could > then use the exec or groovy plugins to process the output file into > the format you want. Interesting. Forgive my ignorance (still a maven newbie) but how might I incorporate that into the build lifecycle? with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
Hi Joshua, On 23/04/2008, at 11:23 PM, Joshua ChaitinPollak wrote: On Apr 23, 2008, at 1:05 AM, Lachlan Deck wrote: - append to the text file a list of the jars bundled (prefixing each with a custom path). That's a tricky one. I'd have to say start with the dependency or assembly plugin and see if they can do what you need. I know one of the plugins can put the jars on your classpath in the Manifest, but we don't use the manifest, so I have no experience with it. Right. This is the bit I'm stuck with... Well, I'm not sure if this is helpful or not, but you can do this: mvn -DoutputFile=foo.txt dependency:list which will put your dependencies in a file called foo.txt. You could then use the exec or groovy plugins to process the output file into the format you want. Interesting. Forgive my ignorance (still a maven newbie) but how might I incorporate that into the build lifecycle? with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
On Apr 23, 2008, at 1:05 AM, Lachlan Deck wrote: - append to the text file a list of the jars bundled (prefixing each with a custom path). That's a tricky one. I'd have to say start with the dependency or assembly plugin and see if they can do what you need. I know one of the plugins can put the jars on your classpath in the Manifest, but we don't use the manifest, so I have no experience with it. Right. This is the bit I'm stuck with... Well, I'm not sure if this is helpful or not, but you can do this: mvn -DoutputFile=foo.txt dependency:list which will put your dependencies in a file called foo.txt. You could then use the exec or groovy plugins to process the output file into the format you want. -Josh -- Joshua ChaitinPollak | Software Engineer Kiva Systems, Inc., 225 Wildwood Ave, Woburn, MA 01970
Re: [newby] how to include/package private libs/*.jar
Hi Joshua, On 23/04/2008, at 10:40 AM, Joshua ChaitinPollak wrote: On Apr 22, 2008, at 8:16 PM, Lachlan Deck wrote: On 23/04/2008, at 12:56 AM, Joshua ChaitinPollak wrote: Have you tried, or has anyone suggested using the system scope? I had thought about it, but, unless I'm mistaken, that assumes that the jar will be found in that location at runtime/deployment also (which it won't). Well, as far as I understand, using the system scope tells Maven not to do anything with it at release time, so putting the library in your release bundle, jar, or whatever, and on the classpath would be your responsiblity. We get around that by using a custom assembly definition and a custom shell script to start our application which puts anything in our libs directory (in our deployed installation) on the classpath. Okay. On the other hand, what we've done internally is created an inhouse Maven repository with Artifactory, and we uploaded our third party jars to the internal 3rd party jar repository (things like JIDE that aren't externally redistributable) I think you mentioned that solution isn't available to you. I might be able to make it happen... we'll see. The part I'm needing help with now is creating the final assembly/ bundle. Specifically I need to do the following: - filter a text file (replacing certain properties) + Well, we do this: ${basedir}/src/main/resources true and then we have a version.properties file that looks like: [EMAIL PROTECTED]:~/src/$ cat src/main/resources/pkg/spec/ version.properties application.repository.version=${buildNumber} application.releasenumber=${project.version} application.customer=${customer} application.repository.url=${project.scm.connection} Those properties are supplied by Maven. I believe you can refer to anything in the block in this fashion as well. Oh, doing that is the easy part. What I'm referring to is filtering the file in such that it dynamically inserts a list of all dependencies prefixed by a custom prefix. What you've mentioned doesn't appear to achieve this. - append to the text file a list of the jars bundled (prefixing each with a custom path). That's a tricky one. I'd have to say start with the dependency or assembly plugin and see if they can do what you need. I know one of the plugins can put the jars on your classpath in the Manifest, but we don't use the manifest, so I have no experience with it. Right. This is the bit I'm stuck with... with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
On Apr 22, 2008, at 8:16 PM, Lachlan Deck wrote: Hi Joshua, On 23/04/2008, at 12:56 AM, Joshua ChaitinPollak wrote: Have you tried, or has anyone suggested using the system scope? I had thought about it, but, unless I'm mistaken, that assumes that the jar will be found in that location at runtime/deployment also (which it won't). Well, as far as I understand, using the system scope tells Maven not to do anything with it at release time, so putting the library in your release bundle, jar, or whatever, and on the classpath would be your responsiblity. We get around that by using a custom assembly definition and a custom shell script to start our application which puts anything in our libs directory (in our deployed installation) on the classpath. On the other hand, what we've done internally is created an inhouse Maven repository with Artifactory, and we uploaded our third party jars to the internal 3rd party jar repository (things like JIDE that aren't externally redistributable) I think you mentioned that solution isn't available to you. I might be able to make it happen... we'll see. The part I'm needing help with now is creating the final assembly/ bundle. Specifically I need to do the following: - filter a text file (replacing certain properties) + Well, we do this: ${basedir}/src/main/resources true and then we have a version.properties file that looks like: [EMAIL PROTECTED]:~/src/$ cat src/main/resources/pkg/spec/ version.properties application.repository.version=${buildNumber} application.releasenumber=${project.version} application.customer=${customer} application.repository.url=${project.scm.connection} Those properties are supplied by Maven. I believe you can refer to anything in the block in this fashion as well. - append to the text file a list of the jars bundled (prefixing each with a custom path). That's a tricky one. I'd have to say start with the dependency or assembly plugin and see if they can do what you need. I know one of the plugins can put the jars on your classpath in the Manifest, but we don't use the manifest, so I have no experience with it. -Josh -- Joshua ChaitinPollak | Software Engineer Kiva Systems, Inc., 225 Wildwood Ave, Woburn, MA 01970
Re: [newby] how to include/package private libs/*.jar
Hi Joshua, On 23/04/2008, at 12:56 AM, Joshua ChaitinPollak wrote: Have you tried, or has anyone suggested using the system scope? I had thought about it, but, unless I'm mistaken, that assumes that the jar will be found in that location at runtime/deployment also (which it won't). On the other hand, what we've done internally is created an inhouse Maven repository with Artifactory, and we uploaded our third party jars to the internal 3rd party jar repository (things like JIDE that aren't externally redistributable) I think you mentioned that solution isn't available to you. I might be able to make it happen... we'll see. The part I'm needing help with now is creating the final assembly/ bundle. Specifically I need to do the following: - filter a text file (replacing certain properties) + - append to the text file a list of the jars bundled (prefixing each with a custom path). Any suggestions? Thanks with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
Lachlan, Have you tried, or has anyone suggested using the system scope? You should be able to do something like this: ... javax.sql jdbc-stdext 2.0 system ${basedir}/lib/3rdpartyLib.jar ... On the other hand, what we've done internally is created an inhouse Maven repository with Artifactory, and we uploaded our third party jars to the internal 3rd party jar repository (things like JIDE that aren't externally redistributable) I think you mentioned that solution isn't available to you. -Josh On Apr 19, 2008, at 11:15 PM, Lachlan Deck wrote: Hi Wayne, On 20/04/2008, at 1:35 AM, Wayne Fay wrote: You also need to quite simply understand that Maven is not Ant (!). While there are some similarities in the two (they both build Java code), there are far more dissimilarities. I do understand this actually ... and from what I've seen so far I'm liking what maven has to offer (especially all the out-of-the-box stuff that comes for free - which a little hunting). Maven has certain beliefs based on best practices about how builds should be organized and performed. One of those best practices is "jars shouldn't go into SCM". So, you won't find a lot of support for this "feature" in Maven. Fair enough. In general, Maven is less flexible than Ant. For example, Maven expects a certain project structure for your code. While you can adjust (through configuration) the location of source code etc, it makes things a little more complex and increases the size of your pom, plus you may run into issues with certain plugins etc. I'm quite a fan of conventions actually... but obviously there's a mind-shift that I needed to grapple with and have questions answered... [1] If you are used to and require a large amount of flexibility in your builds, then please stick with Ant. Those of us who have migrated to Maven generally believe we are better off as a result, but there is a transition period and the mindset is a bit different. Yep. I'm getting there. I'm also curious -- why are you moving to Maven for this particular project? Because I, personally, was fed up with ant. For some of the simplest things I had to write my own plugin to achieve what should just work - but even then, for the particular environment I'm working in, it was too system dependent (e.g., on external configs etc... long story). So I started looking at maven slowly on the side at first (as obviously there's a bit of reading to do in order to understand the thing and so forth). In the end I liked what I saw and quite quickly saw the potential for less pain + lots of extras ;-) Was a mandate handed down from someone above you, or did a customer ask for it, or was it simply personal interest? You mention that you have no ability to create a shared repo etc, so I wonder where all this is coming from... [1] Yeah, my questions were really in anticipation of questions that I know will come from up the chain, so to speak. "Why can't we just put them in subversion?! etc etc" I could go on... but essentially I need to have enough good reasons for moving in another direction. With a better understanding now of how to create a repository, it turns out I might very well be able to set up a shared one after all. I'm thinking that I could maybe set up the remote one as a mirror of a custom repo on my local system (at first) and rsync the two when needed. The pom could reference the remote repo but perhaps in my settings.xml file I could override the location to point to my local copy when offline(?) Any suggestions on this? with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joshua ChaitinPollak | Software Engineer Kiva Systems, Inc., 225 Wildwood Ave, Woburn, MA 01970 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
Hi Wayne, On 20/04/2008, at 1:35 AM, Wayne Fay wrote: You also need to quite simply understand that Maven is not Ant (!). While there are some similarities in the two (they both build Java code), there are far more dissimilarities. I do understand this actually ... and from what I've seen so far I'm liking what maven has to offer (especially all the out-of-the-box stuff that comes for free - which a little hunting). Maven has certain beliefs based on best practices about how builds should be organized and performed. One of those best practices is "jars shouldn't go into SCM". So, you won't find a lot of support for this "feature" in Maven. Fair enough. In general, Maven is less flexible than Ant. For example, Maven expects a certain project structure for your code. While you can adjust (through configuration) the location of source code etc, it makes things a little more complex and increases the size of your pom, plus you may run into issues with certain plugins etc. I'm quite a fan of conventions actually... but obviously there's a mind-shift that I needed to grapple with and have questions answered... [1] If you are used to and require a large amount of flexibility in your builds, then please stick with Ant. Those of us who have migrated to Maven generally believe we are better off as a result, but there is a transition period and the mindset is a bit different. Yep. I'm getting there. I'm also curious -- why are you moving to Maven for this particular project? Because I, personally, was fed up with ant. For some of the simplest things I had to write my own plugin to achieve what should just work - but even then, for the particular environment I'm working in, it was too system dependent (e.g., on external configs etc... long story). So I started looking at maven slowly on the side at first (as obviously there's a bit of reading to do in order to understand the thing and so forth). In the end I liked what I saw and quite quickly saw the potential for less pain + lots of extras ;-) Was a mandate handed down from someone above you, or did a customer ask for it, or was it simply personal interest? You mention that you have no ability to create a shared repo etc, so I wonder where all this is coming from... [1] Yeah, my questions were really in anticipation of questions that I know will come from up the chain, so to speak. "Why can't we just put them in subversion?! etc etc" I could go on... but essentially I need to have enough good reasons for moving in another direction. With a better understanding now of how to create a repository, it turns out I might very well be able to set up a shared one after all. I'm thinking that I could maybe set up the remote one as a mirror of a custom repo on my local system (at first) and rsync the two when needed. The pom could reference the remote repo but perhaps in my settings.xml file I could override the location to point to my local copy when offline(?) Any suggestions on this? with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
Lachlan, You also need to quite simply understand that Maven is not Ant (!). While there are some similarities in the two (they both build Java code), there are far more dissimilarities. Maven has certain beliefs based on best practices about how builds should be organized and performed. One of those best practices is "jars shouldn't go into SCM". So, you won't find a lot of support for this "feature" in Maven. In general, Maven is less flexible than Ant. For example, Maven expects a certain project structure for your code. While you can adjust (through configuration) the location of source code etc, it makes things a little more complex and increases the size of your pom, plus you may run into issues with certain plugins etc. If you are used to and require a large amount of flexibility in your builds, then please stick with Ant. Those of us who have migrated to Maven generally believe we are better off as a result, but there is a transition period and the mindset is a bit different. I'm also curious -- why are you moving to Maven for this particular project? Was a mandate handed down from someone above you, or did a customer ask for it, or was it simply personal interest? You mention that you have no ability to create a shared repo etc, so I wonder where all this is coming from... Wayne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
> > A Maven Repository Manager can store the artifacts on a file system and > you > > can delete old -SNAPSHOTs (which is allowed) > > How is this done? You were already told this -- Archiva, Nexus, Artifactory, etc are "Maven Repository Managers". They can manage snapshots for you. > > Deleting old releases is not really the way a repository is designed to > > work. > > Not really - but is there a command for doing so? rm -rf ~/.m2/repository will take care of the local repo cache. For managing a remote repo, you should be using Archiva, Nexus, Artifactory, etc. As for your earlier question, this does exist, it is called system but it is generally considered a bad thing to use it. In this particular case, you may want to look into it. Wayne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
Hi Lachlan, On Sat, Apr 19, 2008 at 8:31 AM, Lachlan Deck <[EMAIL PROTECTED]> wrote: > On 19/04/2008, at 8:51 PM, Stephen Connolly wrote: > > > Deleting old releases is not really the way a repository is designed to > > work. > > > > Not really - but is there a command for doing so? > Could you try the purge-local-repository goal of the maven-dependency-plugin? See the docs here [1]. I never used this goal, but I think it can help you. [1]http://maven.apache.org/plugins/maven-dependency-plugin/purge-local-repository-mojo.html Cheers Henrique > > > Thanks again. > > with regards, > -- > > Lachlan Deck > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
On 19/04/2008, at 8:51 PM, Stephen Connolly wrote: Okay I think my next question would be: is there an easy maven command for culling jars prior to a certain version from a repository? e.g., say I've added versions 1, 2, 3 and 4 to the repository (such as nightly builds or something)... is there a command that would easily remove versions prior to 3? And now you see why keeping a repository in SVN is a bad thing! Yep. It's worth saying, however, that there's the ideal and then... there's management ;-) Once they go into SVN they can never be removed... (OK, so you can hide them, but they are still in your SVN repository, so why even bother hiding them, you're not going to ever be able to reclaim that space from your SV repository) Good point - but space is really not my concern. Space is relatively cheap. A Maven Repository Manager can store the artifacts on a file system and you can delete old -SNAPSHOTs (which is allowed) How is this done? Deleting old releases is not really the way a repository is designed to work. Not really - but is there a command for doing so? Thanks again. with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
> Okay I think my next question would be: is there an easy maven command for > culling jars prior to a certain version from a repository? > e.g., say I've added versions 1, 2, 3 and 4 to the repository (such as > nightly builds or something)... is there a command that would easily remove > versions prior to 3? > > And now you see why keeping a repository in SVN is a bad thing! Once they go into SVN they can never be removed... (OK, so you can hide them, but they are still in your SVN repository, so why even bother hiding them, you're not going to ever be able to reclaim that space from your SV repository) A Maven Repository Manager can store the artifacts on a file system and you can delete old -SNAPSHOTs (which is allowed) Deleting old releases is not really the way a repository is designed to work. -Stephen
Re: [newby] how to include/package private libs/*.jar
Maven repositories are designed to be write once, delete never... so you'd have to script that yourself. On Sat, Apr 19, 2008 at 11:31 AM, Lachlan Deck <[EMAIL PROTECTED]> wrote: > Hi Stephen, > > On 19/04/2008, at 6:10 PM, Stephen Connolly wrote: > > The following is _not_ recommended. > > > > Once you get more used to Maven you will realize that storing your > > binary > > artifacts in SVN is a "bad thing". > > > > Fundamentally, they are a different creature from the source code. > > > > I mostly concur - however in this case, the particular jar files of > interest seem more like a static resource as they're provided by a 3rd > party, will rarely be updated, and come pre-built. They simply need to be on > the classpath at compile/runtime. > > What you should do is use a Maven repository manager (e.g. Nexus, > > Artifactory, etc) and deploy your binary artifacts to that manager. > > > > Not possible in this scenario... for better or worse. > > There is a poor man's solution to your problem... and that is to fake a > > remote repository in subversion providing your subversion is served over > > http (if Maven > 2.0) or https (if Maven > 2.0.5) > > > > You add a repository definition where the repository URL is the place in > > SVN > > where you are keeping your remote repository > > > > Basically, you'd be doing similar to what has been done at > > https://maven2-repository.dev.java.net > > > > That way your binaries are kept in SVN, but the developer does not check > > out > > the trunk of that repository, only accesses it via HTTP > > > > Just to be clear - the only jars that'll be in this psuedo repo will be > those used by the project. But what you're suggesting would be quite useful. > Naturally that'll require authentication in each persons settings file. No > problems. > > Okay I think my next question would be: is there an easy maven command for > culling jars prior to a certain version from a repository? > e.g., say I've added versions 1, 2, 3 and 4 to the repository (such as > nightly builds or something)... is there a command that would easily remove > versions prior to 3? > > Thanks again... > > > with regards, > -- > > Lachlan Deck > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: [newby] how to include/package private libs/*.jar
Hi Stephen, On 19/04/2008, at 6:10 PM, Stephen Connolly wrote: The following is _not_ recommended. Once you get more used to Maven you will realize that storing your binary artifacts in SVN is a "bad thing". Fundamentally, they are a different creature from the source code. I mostly concur - however in this case, the particular jar files of interest seem more like a static resource as they're provided by a 3rd party, will rarely be updated, and come pre-built. They simply need to be on the classpath at compile/runtime. What you should do is use a Maven repository manager (e.g. Nexus, Artifactory, etc) and deploy your binary artifacts to that manager. Not possible in this scenario... for better or worse. There is a poor man's solution to your problem... and that is to fake a remote repository in subversion providing your subversion is served over http (if Maven > 2.0) or https (if Maven > 2.0.5) You add a repository definition where the repository URL is the place in SVN where you are keeping your remote repository Basically, you'd be doing similar to what has been done at https://maven2-repository.dev.java.net That way your binaries are kept in SVN, but the developer does not check out the trunk of that repository, only accesses it via HTTP Just to be clear - the only jars that'll be in this psuedo repo will be those used by the project. But what you're suggesting would be quite useful. Naturally that'll require authentication in each persons settings file. No problems. Okay I think my next question would be: is there an easy maven command for culling jars prior to a certain version from a repository? e.g., say I've added versions 1, 2, 3 and 4 to the repository (such as nightly builds or something)... is there a command that would easily remove versions prior to 3? Thanks again... with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
The following is _not_ recommended. Once you get more used to Maven you will realize that storing your binary artifacts in SVN is a "bad thing". Fundamentally, they are a different creature from the source code. What you should do is use a Maven repository manager (e.g. Nexus, Artifactory, etc) and deploy your binary artifacts to that manager. There is a poor man's solution to your problem... and that is to fake a remote repository in subversion providing your subversion is served over http (if Maven > 2.0) or https (if Maven > 2.0.5) You add a repository definition where the repository URL is the place in SVN where you are keeping your remote repository Basically, you'd be doing similar to what has been done at https://maven2-repository.dev.java.net That way your binaries are kept in SVN, but the developer does not check out the trunk of that repository, only accesses it via HTTP -Stephen On Sat, Apr 19, 2008 at 8:28 AM, Lachlan Deck <[EMAIL PROTECTED]> wrote: > Hi Mark, > > On 19/04/2008, at 5:13 PM, Mark Struberg wrote: > > To be more specific: > > Look at the maven-deploy-plugin > > > > http://maven.apache.org/plugins/maven-deploy-plugin/usage.html > > > > and use the > > > > > mvn deploy:deploy-file > > > > > mojo > > > > Example: > > mvn deploy:deploy-file -DrepositoryId=myrepo.id \ > > -Dfile=myjartoupload.jar \ > > -DgroupId=my.groupId \ > > -DartifactId=my-artifactId \ > > -Dversion=myversion \ > > -Dpackaging=jar \ > > > > You can use this mojo from everywhere, since it is marked as > > '@requiresProject false'. > > > > If this was successfull (check your ~/.m2/repository), you may remove > > this jar from your lib > > folder and add the dependency in your pom. > > > > I'm wondering how this helps another developer who checks out the project? > Or indeed if my system gets somehow hosed? > > I have no permissions to be creating a shared repo. Thus I need to be able > to keep the jars with the project. With ant this was completely simple (one > of the few nice things about ant)... so I don't quite appreciate why it > needs to be so complex with maven? > > Fair enough for world-sharable jars (i.e., all the various open-source > projects out there) - but for a private jar I can't see the sense in it (at > least yet). > > Thanks... > > with regards, > -- > > Lachlan Deck > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: [newby] how to include/package private libs/*.jar
Hi Mark, On 19/04/2008, at 5:13 PM, Mark Struberg wrote: To be more specific: Look at the maven-deploy-plugin http://maven.apache.org/plugins/maven-deploy-plugin/usage.html and use the mvn deploy:deploy-file mojo Example: mvn deploy:deploy-file -DrepositoryId=myrepo.id \ -Dfile=myjartoupload.jar \ -DgroupId=my.groupId \ -DartifactId=my-artifactId \ -Dversion=myversion \ -Dpackaging=jar \ You can use this mojo from everywhere, since it is marked as '@requiresProject false'. If this was successfull (check your ~/.m2/repository), you may remove this jar from your lib folder and add the dependency in your pom. I'm wondering how this helps another developer who checks out the project? Or indeed if my system gets somehow hosed? I have no permissions to be creating a shared repo. Thus I need to be able to keep the jars with the project. With ant this was completely simple (one of the few nice things about ant)... so I don't quite appreciate why it needs to be so complex with maven? Fair enough for world-sharable jars (i.e., all the various open-source projects out there) - but for a private jar I can't see the sense in it (at least yet). Thanks... with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
Hi Henrique, On 19/04/2008, at 6:52 AM, Henrique Prange wrote: It is not recommended that you store your jars in SVN. So, there is no simple way to do what you want with Maven. Recommended or not - I simply cannot go another route. The project needs to be self-contained which requires another developer to check it out via svn without any further hassles. Similarly a build server needs to be able to svn up && build... Putting it in my local repository seems kind of pointless as it's not in subversion and the project will fail to build elsewhere. It also seems to assume that the repo is publicly available (or at least on vpn). This seems more like a philosophical limitation, if I can put it that way :-) i.e., it seems to me that there's nothing technically difficult for maven to support this: ... i.e., where artifactId, groupId, and version are optional if the systemPath is supplied - seeing as it's kind of redundant when systemPath is supplied as far as I can see. But you can create a repository to share your own libraries (Maven can generate the pom.xml for you). Take a look at [1] and [2]. [1]http://maven.apache.org/guides/introduction/introduction-to-repositories.html [2]http://maven.apache.org/guides/mini/guide-3rd-party-jars- remote.html Thanks for those links. I had already seen the first and a variation on the 2nd... perhaps I can create a local repo for that framework with the localRepositoryPath etc options http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html Seems like it's a bit over the top - but if it works then that's Good Enough For Now(tm). Cheers from your WO friend, ;) :-) Henrique Lachlan Deck wrote: Hi there, I'm quite new to maven, but I would have thought this question would have been included on the FAQ page for maven - but it's not. I've googled around but mustn't be putting in the right search phrase or something... as obviously I've not found the answer :-) The simple question is how do I define dependencies on libs/*.jar for one of my projects where I have jars from a 3rd party (a payment gateway) in the project's lib folder. These libs live in svn with the project - not in a repo (and don't have a version or a pom of their own - they're just libs). i.e., they obviously need to be on the classpath + packaged with the final jar? I'm sure it's something simple... thanks in advance. with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
To be more specific: Look at the maven-deploy-plugin http://maven.apache.org/plugins/maven-deploy-plugin/usage.html and use the > mvn deploy:deploy-file mojo Example: mvn deploy:deploy-file -DrepositoryId=myrepo.id \ -Dfile=myjartoupload.jar \ -DgroupId=my.groupId \ -DartifactId=my-artifactId \ -Dversion=myversion \ -Dpackaging=jar \ You can use this mojo from everywhere, since it is marked as '@requiresProject false'. If this was successfull (check your ~/.m2/repository), you may remove this jar from your lib folder and add the dependency in your pom. hope this helps, strub --- Johan Eltes <[EMAIL PROTECTED]> schrieb: > You need to put them in you local repo. You don't need to create a pom > for them. > > /Johan > > > > 18 apr 2008 kl. 22.05 Lachlan Deck <[EMAIL PROTECTED]> skrev: > > > Hi there, > > > > I'm quite new to maven, but I would have thought this question would > > have been included on the FAQ page for maven - but it's not. I've > > googled around but mustn't be putting in the right search phrase or > > something... as obviously I've not found the answer :-) > > > > The simple question is how do I define dependencies on libs/*.jar > > for one of my projects where I have jars from a 3rd party (a payment > > gateway) in the project's lib folder. These libs live in svn with > > the project - not in a repo (and don't have a version or a pom of > > their own - they're just libs). > > > > i.e., they obviously need to be on the classpath + packaged with the > > final jar? > > > > I'm sure it's something simple... thanks in advance. > > > > with regards, > > -- > > > > Lachlan Deck > > __ Gesendet von Yahoo! Mail. Der Mailbox mit unbegrenztem Speicher. http://de.overview.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
You need to put them in you local repo. You don't need to create a pom for them. /Johan 18 apr 2008 kl. 22.05 Lachlan Deck <[EMAIL PROTECTED]> skrev: Hi there, I'm quite new to maven, but I would have thought this question would have been included on the FAQ page for maven - but it's not. I've googled around but mustn't be putting in the right search phrase or something... as obviously I've not found the answer :-) The simple question is how do I define dependencies on libs/*.jar for one of my projects where I have jars from a 3rd party (a payment gateway) in the project's lib folder. These libs live in svn with the project - not in a repo (and don't have a version or a pom of their own - they're just libs). i.e., they obviously need to be on the classpath + packaged with the final jar? I'm sure it's something simple... thanks in advance. with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newby] how to include/package private libs/*.jar
Hi Lachan, It is not recommended that you store your jars in SVN. So, there is no simple way to do what you want with Maven. But you can create a repository to share your own libraries (Maven can generate the pom.xml for you). Take a look at [1] and [2]. [1]http://maven.apache.org/guides/introduction/introduction-to-repositories.html [2]http://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html Cheers from your WO friend, ;) Henrique Lachlan Deck wrote: Hi there, I'm quite new to maven, but I would have thought this question would have been included on the FAQ page for maven - but it's not. I've googled around but mustn't be putting in the right search phrase or something... as obviously I've not found the answer :-) The simple question is how do I define dependencies on libs/*.jar for one of my projects where I have jars from a 3rd party (a payment gateway) in the project's lib folder. These libs live in svn with the project - not in a repo (and don't have a version or a pom of their own - they're just libs). i.e., they obviously need to be on the classpath + packaged with the final jar? I'm sure it's something simple... thanks in advance. with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[newby] how to include/package private libs/*.jar
Hi there, I'm quite new to maven, but I would have thought this question would have been included on the FAQ page for maven - but it's not. I've googled around but mustn't be putting in the right search phrase or something... as obviously I've not found the answer :-) The simple question is how do I define dependencies on libs/*.jar for one of my projects where I have jars from a 3rd party (a payment gateway) in the project's lib folder. These libs live in svn with the project - not in a repo (and don't have a version or a pom of their own - they're just libs). i.e., they obviously need to be on the classpath + packaged with the final jar? I'm sure it's something simple... thanks in advance. with regards, -- Lachlan Deck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]