Re: Maven Assemblies
Hi David, Thanks for your help. I kept seeing the assembly file referenced, but nothing too much on where it should be. http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) Isn't this enough ? Or do i misunderstand things ? There are two issues I am having: 1). In the tarball, the lib directory is owned by build/user, but the bin and conf directory is owned by 0/0. Is there a way to set this? I didn't see anything in the Assembly settings. http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_fileSet You should take a look at the filemode ... Hm. under which user are you running maven ? 2). My boss wants to know why is the assembly file called bin.xml. I told him because the assembly file is a bin type, and you name the assembly file after the assembly type. He wants to see documentation to this effect. Is there such documentation? I know you can call your assembly file anything you want, but if this is the Maven standard, I want to stick with it. First you can call it the way you like but there are some defaults in there http://maven.apache.org/plugins/maven-assembly-plugin/assembly-mojo.html#descriptorRefs Or in Maven: The definitive Guid at section Predefined Assembly Descriptors...you can see things linke bin are referenced... Kind regards Karl Heinz Marbaise -- SoftwareEntwicklung Beratung SchulungTel.: +49 (0) 2405 / 415 893 Dipl.Ing.(FH) Karl Heinz MarbaiseICQ#: 135949029 Hauptstrasse 177 USt.IdNr: DE191347579 52146 Würselen http://www.soebes.de - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Assemblies
On Thu, Jan 29, 2009 at 5:37 AM, Karl Heinz Marbaise khmarba...@gmx.de wrote: Hi David, Thanks for your help. I kept seeing the assembly file referenced, but nothing too much on where it should be. http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) Isn't this enough ? Or do i misunderstand things ? That was handy, but when you're reading what is suppose to be the definitive Maven reference book on Assemblies, and the book doesn't mention whether or not the Assembly file is suppose to be a separate file or where it is stored... Well, you can see why I can get frustrated. There may be a lot of information about Maven out there, but it can be difficult to track down. For example, I spent hours on the distribution plugin: http://maven.apache.org/maven-1.x/plugins/dist/goals.html which I found doing a Google search. I just couldn't get it to work. I finally decided that maybe I have to put the plugin into my local repository, went to the download page and suddenly realized not one of those links points to a downloadable distribution plugin file. Each one was one 404 error after another. (Yes, I now realize that this is a Maven 1.x plugin). When I went up the Maven web page hierarchy, I discovered that this plugin was not listed. http://maven.apache.org/plugins/index.html. So, I then looked at the Packaging Types/Tools since a tarball is a type of package. I then played with the shade type since it says this is an Uber-Jar, I thought maybe that's a way to package things instead of using tarballs or zip files. Spent another few hours playing with that. It took me a while to realize what I wanted to do was to create an Assembly. It is certainly difficult to look at the description of an Assembly on Maven's plugin page to realize that this would be a tool you need in order to actually build a tarball or zip file. It isn't even listed under packaging tools. However, once I realized I wanted to create an Assembly, I could start reading the chapter on Assemblies in Maven -- The Definitive Guide. But as I mentioned above, the book doesn't seem to mention where assembly files are stored or even if they are a separate file from your POM. It isn't that I am new at using open source software world. Nor, do I expect to be trained or have people do my work for me. But, Maven is an extremely complex piece of software and the documentation is not well organized. Take a look at Subversion. One of the reasons Subversion has done so well is that it has excellent documentation. The definitive Subversion book isn't merely a reference, but a well written step-by-step manual explaining how Subversion is used. It then goes through administration, explaining possible gotchas, and gives some nice examples. The FAQ section is quite clear. Ant's documentation isn't quite as nice, but at least it gives some nice examples on how the various tasks are used. It took me a while to learn Ant, but I was able to through the web page. Plus, there are a lot of excellent books on Ant. The whole purpose of Maven was to eliminate the need for me, the CM, to do the build scripting. I've spent most of my career writing or helping developers to write makefiles and later on Ant build scripts. Most of the time, it falls on me to do this type of work. Maven was suppose to be a way for developers not to worry about how builds happen because Maven will take care of it. Now, I am sitting around and writing Maven POMs for my developers. And, because the way Maven works, I now have to fiddle with the source code, something I didn't have to do with Ant and Makefiles. Our developers hate Maven and simply find it incomprehensible. Here's the latest request from one of our developers: Thanks for arranging the folder structure to generate deployable artifact as per requirement. We have taken latest code from SVN. We need following change in generated 'target' folder when we run the 'mvn compile' command. 1) Generated 'target' folder contains 'test-classes'. But some of the test cases are failing because they have dependency on 'conf' and 'data' folders. Can you please modify the maven script such a way that it will put 'conf' and 'data' into 'target\test-classes\' Why in the F in RFTM am I responsible for this? I was doing this for developers in Ant build.xml files. Maven is suppose to take me out of the picture! So, please understand my frustration. I am not a developer, and this is the first time I am working with Maven. Once you get the hang of everything in Maven, it might be easier to understand and tweak things the way you want. But, Maven is a difficult piece of software to understand, and the documentation for Maven is still in a rather preliminary state. There are two issues I am having: 1). In the tarball, the lib directory is owned by build/user, but the bin and conf directory is owned by 0/0. Is there a way to set this? I didn't see anything in the Assembly
Maven Assemblies
I'm building a JAR file that needs to be packaged with some shell scripts and some configuration files. The shell scripts will be in a bin directory, the configuration files will be in a conf directory, and I'd like the jar in the lib directory with any of the dependency jars mentioned in the POM. I've read about Assemblies in Maven -- The Definitive Guide, but I am a little confused about them. It looks like the Assembly is separate from the POM. Is this true? If it is separate from the POM, where is it suppose to live, and how does the POM refer to it? I figure this is a pretty standard setup for a standalone JAR application, but I haven't seen any examples of this particular setup. -- David Weintraub qazw...@gmail.com - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Maven Assemblies
The assembly descriptor (i.e. the file that defines the directory structure and contents of the assembly) is a separate file from the POM. They are typically placed in src/main/assembly/. See http://maven.apache.org/plugins/maven-assembly-plugin/usage.html for examples of how to configure the assembly plugin in your POM to point to the assembly descriptor file name. Justin From: David Weintraub [mailto:qazw...@gmail.com] Sent: Wed 1/28/2009 8:29 AM To: Maven Users List Cc: jk...@solbright.com Subject: Maven Assemblies I'm building a JAR file that needs to be packaged with some shell scripts and some configuration files. The shell scripts will be in a bin directory, the configuration files will be in a conf directory, and I'd like the jar in the lib directory with any of the dependency jars mentioned in the POM. I've read about Assemblies in Maven -- The Definitive Guide, but I am a little confused about them. It looks like the Assembly is separate from the POM. Is this true? If it is separate from the POM, where is it suppose to live, and how does the POM refer to it? I figure this is a pretty standard setup for a standalone JAR application, but I haven't seen any examples of this particular setup. -- David Weintraub qazw...@gmail.com - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Assemblies
Hi David, I'm building a JAR file that needs to be packaged with some shell scripts and some configuration files. The shell scripts will be in a bin directory, the configuration files will be in a conf directory, and I'd like the jar in the lib directory with any of the dependency jars mentioned in the POM. I've read about Assemblies in Maven -- The Definitive Guide, but I am a little confused about them. It looks like the Assembly is separate from the POM. Is this true? If it is separate from the POM, where is it suppose to live, and how does the POM refer to it? It's correct that's outside the pom. It lives in src/main/assembly or something like this...(see http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) I figure this is a pretty standard setup for a standalone JAR application, but I haven't seen any examples of this particular setup. e.g. the following is a bin.xml assembly discriptor: May be you have to change the include and the exclude section a bit. assembly idbin/id formats formattar.gz/format formatzip/format /formats baseDirectory${artifactId}-${version}/baseDirectory includeSiteDirectoryfalse/includeSiteDirectory dependencySets dependencySet outputDirectorylib/outputDirectory unpackfalse/unpack scoperuntime/scope /dependencySet /dependencySets fileSets fileSet filteredtrue/filtered includes includesupose.cmd/include /includes /fileSet fileSet includes includesearch-examples.txt/include /includes excludes exclude*.log/exclude excludebin/**/exclude excludebuild/**/exclude excludedist/**/exclude excludetest-output/**/exclude exclude**/target/**/exclude /excludes /fileSet /fileSets /assembly Within the pom you have to put the following: There you can configure where to put the assembly descriptors... plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-assembly-plugin/artifactId version2.2-beta-3/version configuration descriptors descriptorsrc/main/assembly/bin.xml/descriptor /descriptors /configuration executions execution phasepackage/phase goals goalsingle/goal /goals /execution /executions /plugin That will bin the creation of the packages to the package phase... -- SoftwareEntwicklung Beratung SchulungTel.: +49 (0) 2405 / 415 893 Dipl.Ing.(FH) Karl Heinz MarbaiseICQ#: 135949029 Hauptstrasse 177 USt.IdNr: DE191347579 52146 Würselen http://www.soebes.de - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Assemblies
Thanks for your help. I kept seeing the assembly file referenced, but nothing too much on where it should be. Here's my Assembly file: assembly idbin/id formats formattar.gz/format /formats baseDirectory${artifactId}-${version}/baseDirectory includeSiteDirectoryfalse/includeSiteDirectory dependencySets dependencySet outputDirectorylib/outputDirectory unpackfalse/unpack scoperuntime/scope /dependencySet /dependencySets fileSets fileSet directorysrc/main/bin/directory outputDirectorybin/outputDirectory lineEndinglf/lineEnding fileMode0755/fileMode includes include**/include /includes /fileSet fileSet directorysrc/main/conf/directory outputDirectoryconf/outputDirectory lineEndinglf/lineEnding fileMode0644/fileMode includes include**/include /includes /fileSet /fileSets /assembly Originally, I tried to create a src/main/instance directory, and any files in that directory would be included in the root of the tar.gz file. However, it kept putting them under src/main/conf/instance in the tarball instead of in the root. I finally just defined two separate filesets. I don't know if I need the include**/include line because this is the default, but it works. There are two issues I am having: 1). In the tarball, the lib directory is owned by build/user, but the bin and conf directory is owned by 0/0. Is there a way to set this? I didn't see anything in the Assembly settings. 2). My boss wants to know why is the assembly file called bin.xml. I told him because the assembly file is a bin type, and you name the assembly file after the assembly type. He wants to see documentation to this effect. Is there such documentation? I know you can call your assembly file anything you want, but if this is the Maven standard, I want to stick with it. On Wed, Jan 28, 2009 at 8:47 AM, Karl Heinz Marbaise khmarba...@gmx.de wrote: Hi David, I'm building a JAR file that needs to be packaged with some shell scripts and some configuration files. The shell scripts will be in a bin directory, the configuration files will be in a conf directory, and I'd like the jar in the lib directory with any of the dependency jars mentioned in the POM. I've read about Assemblies in Maven -- The Definitive Guide, but I am a little confused about them. It looks like the Assembly is separate from the POM. Is this true? If it is separate from the POM, where is it suppose to live, and how does the POM refer to it? It's correct that's outside the pom. It lives in src/main/assembly or something like this...(see http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) I figure this is a pretty standard setup for a standalone JAR application, but I haven't seen any examples of this particular setup. e.g. the following is a bin.xml assembly discriptor: May be you have to change the include and the exclude section a bit. assembly idbin/id formats formattar.gz/format formatzip/format /formats baseDirectory${artifactId}-${version}/baseDirectory includeSiteDirectoryfalse/includeSiteDirectory dependencySets dependencySet outputDirectorylib/outputDirectory unpackfalse/unpack scoperuntime/scope /dependencySet /dependencySets fileSets fileSet filteredtrue/filtered includes includesupose.cmd/include /includes /fileSet fileSet includes includesearch-examples.txt/include /includes excludes exclude*.log/exclude excludebin/**/exclude excludebuild/**/exclude excludedist/**/exclude excludetest-output/**/exclude exclude**/target/**/exclude /excludes /fileSet /fileSets /assembly Within the pom you have to put the following: There you can configure where to put the assembly descriptors... plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-assembly-plugin/artifactId version2.2-beta-3/version configuration descriptors descriptorsrc/main/assembly/bin.xml/descriptor /descriptors /configuration executions execution phasepackage/phase goals goalsingle/goal /goals /execution /executions /plugin That will bin the creation of the packages to the package phase... -- SoftwareEntwicklung Beratung SchulungTel.: +49 (0) 2405 / 415 893 Dipl.Ing.(FH) Karl Heinz MarbaiseICQ#: 135949029 Hauptstrasse 177