How would you approach this?
Hi, I've been writing to the list off and on over the past few days. I'm a ColdFusion developer and I'm looking at Maven for a few different reasons. Mainly, I'm exploring the option of using Groovy+Spring+Hibernate to create the service layers and models for my applications. ColdFusion is simply a JEE app that can compile CFML code to Java bytecode and execute it. A typicaly ColdFuson developer would treat ColdFusion similar to how a PHP developer might. IE, they'd connect ColdFusion (running in its container) to a web server like Apache and have it compile and run CFML source code. However, because CF is Java we also have the ability to easily instantiate Java classes and work with them. CF is great for presentation work and many OO development tasks, but it's interpreted nature can sometimes cause issues. So there's a bit of a moment to look at Groovy to create a Java-based, compiled model and then using MVC frameworks in ColdFusion for presentation. This also makes a nice way to share an application's model between Flex and HTML UIs. Anyhow, ColdFusion itself can be deployed as a WAR or EAR file. If you do a WAR deployment there's actually both a cfusion.war and rds.war file. Both are needed to get the full range of features of the language and server. If I deployed the ear file both war files are included in it. If I were to deply war files to Jboss, for example, I'd put both war files (epanded) into the /server/default/deploy directory. When working with Maven, I'm not quite sure how to accomplish this. I've found that if I can expand the cfusion.war into the default webapp archetype's src/main/webapp directory and it will just work. However, I'm not sure where to put the rds.war, or if it's even possible to run more than on war file through maven. How would you do this? My ultimate goal would be to have something like this: A parent project to build everything. A child project for my Groovy/Java code. This gets compiled into a jar and used by my next child project. Another child project which would be a webapp with the cfusion.war and rds.war deployed into it, along with any CFML code and the jar created in the first child project. This would be built into well, I'm not 100% sure. :) Probably a war file that would be deployed to a server but maybe it would really just be one war which as CF, my jar, and CFML code. The second rds.war would be used essentialy as-is. Anyhow, I'd appreciate your feedback and suggestions. Thanks, Doug Hughes
Re: Creating archetypes and disabling velocity
Ok, I managed to get this to work (mostly). What I did initially that wasn't working was this: 1) I created a new maven project and set it up the way I wanted it to be. 2) I then used archetype:create-from-project to create a new archetype. 3) I went under /target/generated-sources/archetype in my project to see my generated archetype. 4) In that location I ran mvn install which built and installed the archetype. 5) I edited the archetype-metadata.xml to remove filtering on all files. 6) I created a new project using archetype:create or archetype:generate As I stated in previous messages this resulting in the archetype-metadata.xml file being ignored and all of my project's files being filtered by velocity. After a lot of playing around, I noticed that there was a file that was generated (and not a part of my previous project) underneath this folder: /src/main/resources/archetype-resources/src/main/resources/META-INF/archetype.xnl. Note that the extension is xnl (with an n), not xml. I changed this to have the xml extension and it seems that caused my archetype-metadata file not to be ingnored. I also have started using only archetype:generate. As of now running archetype:generate doesn't fail, which is a good start. I do, however, still have another problem: Every single txt, xml, and java file in my archetype is being prepended with this: #set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) This is causing my new project created from the archetype to fail. This is happening when the archetype is being installed. I'm not sure when or why, as my archetype-metadata.xml file is supposed to be causing all files *not* to be filtered: ?xml version=1.0 encoding=UTF-8? archetype-descriptor name=ColdFusion9Beta fileSets fileSet filtered=false packaged=false directorysrc/main/webapp/directory includes include**/*.*/include /includes /fileSet /fileSets /archetype-descriptor Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Sun, May 10, 2009 at 5:57 PM, Doug Hughes d...@doughughes.net wrote: Martin, Thanks for the suggestion the thing is, that's what this tread started about. I have an archetype-metadata.xml file and followed the documentation (not at the link you provided which, fyi, doesn't document the filtered or packaged attributes). Anyhow, it seems that the archetype-metadata.xml file is being ignored. No mater what I put in that file (including invalid xml), it makes no difference. It's like the file doesn't even exist. I'll send more information on the structure of the archetype project and my various files and the commands I'm running later. Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Sun, May 10, 2009 at 4:26 PM, Martin Gainty mgai...@hotmail.comwrote: how about adding includes for wanted extensions and excludes for files to be excluded such as this FileSet declaration for archetype-metadata.xml file? archetype-descriptor !-- usual declaration statements -- fileSets fileSet filtered=true packaged=false directorysrc/site/directory includes include**/*.ftl/include /includes excludes exclude**/*.vm/exclude /excludes? /fileSet /fileSets /archetype-descriptor http://ant.apache.org/manual/CoreTypes/fileset.html ? Martin Gainty __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Sun, 10 May 2009 21
Re: Creating archetypes and disabling velocity
Thank you! That was extremely helpful! I used -DarchetypeFilteredExtentions as you recommended and was able to create my archetype and generate based on this and my new project was setup perfectly (or so it seems right now). I've logged the Jira ticket as your requested for the xNl file extension. Thank, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 2009/5/11 Raphaël Piéroni raphaelpier...@gmail.com Hi Doug, Please raise a jira for the xNl instead of xMl. One can configure the create-from-project mojo to have the file unfiltered by default using: -DarchetypeFilteredExtentions=unknownExtension which sets the file extension for files that will be filtered. by default there is java, js, xml and some more i don't remember. Hope this helps Raphaël 2009/5/11 Doug Hughes d...@doughughes.net Ok, I managed to get this to work (mostly). What I did initially that wasn't working was this: 1) I created a new maven project and set it up the way I wanted it to be. 2) I then used archetype:create-from-project to create a new archetype. 3) I went under /target/generated-sources/archetype in my project to see my generated archetype. 4) In that location I ran mvn install which built and installed the archetype. 5) I edited the archetype-metadata.xml to remove filtering on all files. 6) I created a new project using archetype:create or archetype:generate As I stated in previous messages this resulting in the archetype-metadata.xml file being ignored and all of my project's files being filtered by velocity. After a lot of playing around, I noticed that there was a file that was generated (and not a part of my previous project) underneath this folder: /src/main/resources/archetype-resources/src/main/resources/META-INF/archetype.xnl. Note that the extension is xnl (with an n), not xml. I changed this to have the xml extension and it seems that caused my archetype-metadata file not to be ingnored. I also have started using only archetype:generate. As of now running archetype:generate doesn't fail, which is a good start. I do, however, still have another problem: Every single txt, xml, and java file in my archetype is being prepended with this: #set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) This is causing my new project created from the archetype to fail. This is happening when the archetype is being installed. I'm not sure when or why, as my archetype-metadata.xml file is supposed to be causing all files *not* to be filtered: ?xml version=1.0 encoding=UTF-8? archetype-descriptor name=ColdFusion9Beta fileSets fileSet filtered=false packaged=false directorysrc/main/webapp/directory includes include**/*.*/include /includes /fileSet /fileSets /archetype-descriptor Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Sun, May 10, 2009 at 5:57 PM, Doug Hughes d...@doughughes.net wrote: Martin, Thanks for the suggestion the thing is, that's what this tread started about. I have an archetype-metadata.xml file and followed the documentation (not at the link you provided which, fyi, doesn't document the filtered or packaged attributes). Anyhow, it seems that the archetype-metadata.xml file is being ignored. No mater what I put in that file (including invalid xml), it makes no difference. It's like the file doesn't even exist. I'll send more information on the structure of the archetype project and my various files and the commands I'm running later. Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Sun, May 10, 2009 at 4:26 PM, Martin Gainty mgai...@hotmail.com wrote: how about adding includes for wanted extensions and excludes for files to be excluded such as this FileSet declaration for archetype-metadata.xml file? archetype-descriptor !-- usual declaration statements -- fileSets fileSet filtered=true packaged=false directorysrc/site/directory includes include**/*.ftl/include /includes excludes exclude**/*.vm/exclude /excludes? /fileSet /fileSets /archetype-descriptor http://ant.apache.org/manual/CoreTypes/fileset.html ? Martin Gainty __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only
Creating a zip of non-java files
Hi, I'm working to create a new project which would have no Java sources or tests in it. The project actually is made up of ColdFusion code. I can't figure out how to get Maven to zip this up. I started by creating a new project and removing the java and test folders. I added a folder src/main/cfml I set the packaging to zip. However, when I do a mvn install I get nothing in the target directory at all. Is there a trick to getting this to zip up the cfml directory? Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836
Re: Creating a zip of non-java files
Will, Thanks. It was particularly nice of you to include some XML form me to review. I'll give it a shot. Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Mon, May 11, 2009 at 12:08 PM, Will Hoover java.whoo...@gmail.comwrote: you could use the maven-assembly-plugin: src/main/assembly/cfml.xml assembly xmlns= http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://maven.apache.org/plugins/maven-assembly-plugin/as sembly/1.1.0http://maven.apache.org/plugins/maven-assembly-plugin/as%0Asembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd; idcfml-resources/id formats formatzip/format /formats !-- includeBaseDirectoryfalse/includeBaseDirectory -- fileSets fileSet directory${basedir}/src/main/cfml/directory outputDirectory/outputDirectory includes include**/*.cfm/include /includes filteredtrue/filtered /fileSet /fileSets /assembly pom.xml ... plugin artifactIdmaven-assembly-plugin/artifactId executions execution idcfml-resources/id goals goalsingle/goal /goals phasepackage/phase configuration descriptors descriptorsrc/main/assembly/cfml.xml/descriptor /descriptors /configuration /execution /executions /plugin ... -Original Message- From: Doug Hughes [mailto:dhug...@alagad.com] Sent: Monday, May 11, 2009 11:21 AM To: Maven Users List Subject: Creating a zip of non-java files Hi, I'm working to create a new project which would have no Java sources or tests in it. The project actually is made up of ColdFusion code. I can't figure out how to get Maven to zip this up. I started by creating a new project and removing the java and test folders. I added a folder src/main/cfml I set the packaging to zip. However, when I do a mvn install I get nothing in the target directory at all. Is there a trick to getting this to zip up the cfml directory? Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a zip of non-java files
Ok, this worked, pretty much. However, there are a few minor problems I'm still researching how to resolve. First off, the zip file always has the name of the assembly appended to the name of the zip file. IE: ModelGlue-1.0-SNAPSHOT-cfml-resources.zip, where cfml-resources is the ID of the assembly. The other issue is that the zip file doesn't include the META-INF folder which would normally hold the pom files that define the dependencies. To clarify what I'm trying to do, I'm trying to create a set of CFML code that can depend on other CFML code that I can use as dependencies for a CFML application. I don't actually need to zip these up. A jar would be just fine. If I change the packaging to jar then I DO get a jar, it just doesn't have any of my CFML code in it. It'd be really great if I could find a way to put everything from the src/main/cfml directory into the root of the jar. If there's any documentation you can recommend on how to do this, that'd be great. I'm really just getting started with Maven and I'm using it for a fairly non-standard language. As such, the learning curve is a bit steep. Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Mon, May 11, 2009 at 12:28 PM, Doug Hughes d...@doughughes.net wrote: Will, Thanks. It was particularly nice of you to include some XML form me to review. I'll give it a shot. Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Mon, May 11, 2009 at 12:08 PM, Will Hoover java.whoo...@gmail.comwrote: you could use the maven-assembly-plugin: src/main/assembly/cfml.xml assembly xmlns= http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://maven.apache.org/plugins/maven-assembly-plugin/as sembly/1.1.0http://maven.apache.org/plugins/maven-assembly-plugin/as%0Asembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd; idcfml-resources/id formats formatzip/format /formats !-- includeBaseDirectoryfalse/includeBaseDirectory -- fileSets fileSet directory${basedir}/src/main/cfml/directory outputDirectory/outputDirectory includes include**/*.cfm/include /includes filteredtrue/filtered /fileSet /fileSets /assembly pom.xml ... plugin artifactIdmaven-assembly-plugin/artifactId executions execution idcfml-resources/id goals goalsingle/goal /goals phasepackage/phase configuration descriptors descriptorsrc/main/assembly/cfml.xml/descriptor /descriptors /configuration /execution /executions /plugin ... -Original Message- From: Doug Hughes [mailto:dhug...@alagad.com] Sent: Monday, May 11, 2009 11:21 AM To: Maven Users List Subject: Creating a zip of non-java files Hi, I'm working to create a new project which would have no Java sources or tests in it. The project actually is made up of ColdFusion code. I can't figure out how to get Maven to zip this up. I started by creating a new project and removing the java and test folders. I added a folder src/main/cfml I set the packaging to zip. However, when I do a mvn install I get nothing in the target directory at all. Is there a trick to getting this to zip up the cfml directory? Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating a zip of non-java files
Only ignorance :) I'm still learning quite a bit. Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Mon, May 11, 2009 at 4:06 PM, Wayne Fay wayne...@gmail.com wrote: I don't actually need to zip these up. A jar would be just fine. If I change the packaging to jar then I DO get a jar, it just doesn't have any of my CFML code in it. It'd be really great if I could find a way to put everything from the src/main/cfml directory into the root of the jar. Any reason you can't just put those files into /src/main/resources? Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating archetypes and disabling velocity
I wanted to add to my last message. I found some instructions on using archetype:create-from-project to create a new archetype. I followed them to create a new archetype project. This had a slightly different file layout than the webapp archetype I was trying to customize before. However, I'm still having the same problem I did before. Specifically, archetype:create seems to be trying to send every file through the velocity system. The archetype:create-from-project did create an archetype-metadata.xml file which I've modified as such in an attempt to completely remove all filtering from my archetype. ?xml version=1.0 encoding=UTF-8? archetype-descriptor name=ColdFusion-archetype fileSets fileSet filtered=false packaged=true directorysrc/main/directory includes include**/*.cfm/include /includes /fileSet /fileSets /archetype-descriptor Unfortuantly, when I run archetype:create I'm still getting the same errors from velocity. Am I going about this the right way? Is there any good documentation on this stuff? Or maybe a useful book I could buy? Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Sat, May 9, 2009 at 11:06 PM, Doug Hughes dhug...@alagad.com wrote: Hi, I'm in the process of creating my first archetype. I've based it on the simple-webapp archetype, but I've added the entire ColdFusion application. This is 4114 files total. I can build and install the archetype just fine using mvn install just fine. However, when I use mvn archetype:create to create a new project based on my archetype I get this in the resulting output: [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 20] : $coldfusion is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 31] : $tagext is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 38] : $lang is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 43] : $RegistryTag is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 62,column 244] : $Lcoldfusion is not a valid reference. [ERROR] ResourceManager.getResource() parse exception: org.apache.velocity.exception.ParseErrorException: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 206, column 35. Encountered: EOF after : I think that what's going on is that the Velosity templating system is seeing $ or ${ or something like that in the ColdFusion files. I'm trying to find a way to tell velosity to ignore these files. Any tips on this? I've read every line of documentation on the archetype plugin I can find, but there's no clear answer. I did find one page which discussed a file called archetype-metadata.xml. The simple-webapp archetype I based this on didn't have one of these files. I added it under src/main/resources/META-INF/maven, with the following XML, but it didn't seem to have any effect at all the next time I tried to create my archetype: ?xml version=1.0 encoding=UTF-8? archetype-descriptor name=basic fileSets fileSet filtered=false packaged=true directorysrc/main/directory includes include**/*.*/include /includes /fileSet /fileSets /archetype-descriptor I get the impression that there are two versions of the archetype plugin and that the I might be building my archetype based on documentation on the archetype 1 plugin and that the archetype-metadata.xml file is specific to version 2? Thanks for your help, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836
Re: Creating archetypes and disabling velocity
Sorry to keep harping on this topic. I'm hoping someone can offer some advice. :) As a last test, I intentionally put invalid XML in the archetype-metadata.xml file. I was able to run archetype:create without it reporting an XML error. This tells me it's ignoring my metadata file anyhow any ideas on what I can do to work around this? Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Sun, May 10, 2009 at 8:58 AM, Doug Hughes dhug...@alagad.com wrote: I wanted to add to my last message. I found some instructions on using archetype:create-from-project to create a new archetype. I followed them to create a new archetype project. This had a slightly different file layout than the webapp archetype I was trying to customize before. However, I'm still having the same problem I did before. Specifically, archetype:create seems to be trying to send every file through the velocity system. The archetype:create-from-project did create an archetype-metadata.xml file which I've modified as such in an attempt to completely remove all filtering from my archetype. ?xml version=1.0 encoding=UTF-8? archetype-descriptor name=ColdFusion-archetype fileSets fileSet filtered=false packaged=true directorysrc/main/directory includes include**/*.cfm/include /includes /fileSet /fileSets /archetype-descriptor Unfortuantly, when I run archetype:create I'm still getting the same errors from velocity. Am I going about this the right way? Is there any good documentation on this stuff? Or maybe a useful book I could buy? Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Sat, May 9, 2009 at 11:06 PM, Doug Hughes dhug...@alagad.com wrote: Hi, I'm in the process of creating my first archetype. I've based it on the simple-webapp archetype, but I've added the entire ColdFusion application. This is 4114 files total. I can build and install the archetype just fine using mvn install just fine. However, when I use mvn archetype:create to create a new project based on my archetype I get this in the resulting output: [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 20] : $coldfusion is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 31] : $tagext is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 38] : $lang is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 43] : $RegistryTag is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 62,column 244] : $Lcoldfusion is not a valid reference. [ERROR] ResourceManager.getResource() parse exception: org.apache.velocity.exception.ParseErrorException: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 206, column 35. Encountered: EOF after : I think that what's going on is that the Velosity templating system is seeing $ or ${ or something like that in the ColdFusion files. I'm trying to find a way to tell velosity to ignore these files. Any tips on this? I've read every line of documentation on the archetype plugin I can find, but there's no clear answer. I did find one page which discussed a file called archetype-metadata.xml. The simple-webapp archetype I based this on didn't have one of these files. I added it under src/main/resources/META-INF/maven, with the following XML, but it didn't seem to have any effect at all the next time I tried to create my archetype: ?xml version=1.0 encoding=UTF-8? archetype-descriptor name=basic fileSets fileSet filtered=false packaged=true directorysrc/main/directory includes include**/*.*/include /includes /fileSet /fileSets /archetype-descriptor I get the impression that there are two versions of the archetype plugin and that the I might be building my archetype based on documentation on the archetype 1 plugin and that the archetype-metadata.xml file is specific to version 2? Thanks for your help, Doug Hughes, President Alagad Inc. dhug
Re: Creating archetypes and disabling velocity
Rather than editing my source files, is there not a way to disable velocity for spcific files or folders? I ask because some of the problem files in my archetype are binary. I'm not too comfortable editing those by hand as you suggest. And I think they may be related to the problems I'm seeing. Thanks, Doug On May 10, 2009, at 12:41 PM, Heinrich Nirschl heinrich.nirs...@gmail.com wrote: On Sun, May 10, 2009 at 3:13 PM, Doug Hughes dhug...@alagad.com wrote: As a last test, I intentionally put invalid XML in the archetype-metadata.xml file. I was able to run archetype:create without it reporting an XML error. This tells me it's ignoring my metadata file anyhow any ideas on what I can do to work around this? I think, this file is only used, if you use the archetype:generate goal. [line 17,column 31] : $tagext is not a valid reference. For the references that should go unchanged into the generated sources I usually do #set ($d = $) ... ${d}{target} ... This will expand to ${target} and will not raise a warning. - Henry - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Creating archetypes and disabling velocity
Martin, Thanks for the suggestion the thing is, that's what this tread started about. I have an archetype-metadata.xml file and followed the documentation (not at the link you provided which, fyi, doesn't document the filtered or packaged attributes). Anyhow, it seems that the archetype-metadata.xml file is being ignored. No mater what I put in that file (including invalid xml), it makes no difference. It's like the file doesn't even exist. I'll send more information on the structure of the archetype project and my various files and the commands I'm running later. Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Sun, May 10, 2009 at 4:26 PM, Martin Gainty mgai...@hotmail.com wrote: how about adding includes for wanted extensions and excludes for files to be excluded such as this FileSet declaration for archetype-metadata.xml file? archetype-descriptor !-- usual declaration statements -- fileSets fileSet filtered=true packaged=false directorysrc/site/directory includes include**/*.ftl/include /includes excludes exclude**/*.vm/exclude /excludes? /fileSet /fileSets /archetype-descriptor http://ant.apache.org/manual/CoreTypes/fileset.html ? Martin Gainty __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Sun, 10 May 2009 21:39:31 +0200 Subject: Re: Creating archetypes and disabling velocity From: heinrich.nirs...@gmail.com To: users@maven.apache.org On Sun, May 10, 2009 at 7:37 PM, Doug Hughes dhug...@alagad.com wrote: Rather than editing my source files, is there not a way to disable velocity for spcific files or folders? I ask because some of the problem files in my archetype are binary. I'm not too comfortable editing those by hand as you suggest. And I think they may be related to the problems I'm seeing. Did you try the filtered=false attribute in the archetype-metadata.xml file when you used the archetype:generate goal? - Henry - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org _ Hotmail® goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009
Creating archetypes and disabling velocity
Hi, I'm in the process of creating my first archetype. I've based it on the simple-webapp archetype, but I've added the entire ColdFusion application. This is 4114 files total. I can build and install the archetype just fine using mvn install just fine. However, when I use mvn archetype:create to create a new project based on my archetype I get this in the resulting output: [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 20] : $coldfusion is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 31] : $tagext is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 38] : $lang is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 17,column 43] : $RegistryTag is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/webapp/CFIDE/adminapi/_datasource/getaccessdefaultsfromregistry.cfm [line 62,column 244] : $Lcoldfusion is not a valid reference. [ERROR] ResourceManager.getResource() parse exception: org.apache.velocity.exception.ParseErrorException: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 206, column 35. Encountered: EOF after : I think that what's going on is that the Velosity templating system is seeing $ or ${ or something like that in the ColdFusion files. I'm trying to find a way to tell velosity to ignore these files. Any tips on this? I've read every line of documentation on the archetype plugin I can find, but there's no clear answer. I did find one page which discussed a file called archetype-metadata.xml. The simple-webapp archetype I based this on didn't have one of these files. I added it under src/main/resources/META-INF/maven, with the following XML, but it didn't seem to have any effect at all the next time I tried to create my archetype: ?xml version=1.0 encoding=UTF-8? archetype-descriptor name=basic fileSets fileSet filtered=false packaged=true directorysrc/main/directory includes include**/*.*/include /includes /fileSet /fileSets /archetype-descriptor I get the impression that there are two versions of the archetype plugin and that the I might be building my archetype based on documentation on the archetype 1 plugin and that the archetype-metadata.xml file is specific to version 2? Thanks for your help, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836
General questions regarding dependencies
Hello, I'm rather new to Maven, but I've been working through the Maven: The Definitive Guide, 1st Edition book. I've been fairly successful so far making Java and Groovy projects and adding dependencies. I've even got it working with Eclipse, which for various reasons was rather painful. I have some questions about how dependencies are handled within Maven. I understand that when you add a dependency that Maven looks at the central repository, finds the correct files and downloads them. I'm wondering if this can only be done for JAR/WAR files? For the record, I'm a ColdFusion/CFML developer. ColdFusion applications are made up of a collection of CFML files. These files are compiled to Java byte code at runtime and executed by the Java server. ColdFusion itself is really just a servlet that handles this process for you. The thing is, there are a number of ColdFusion frameworks that are commonly used. There's a framework similar to Spring called ColdSpring, there's an MVC framework called Model-Glue (which has a dependency on ColdSpring), and there are a few ORM frameworks to choose frome. A framework in CF are really just a directory filled with various CFML files. There isn't a concept like a JAR file in CF. So, if I wanted to use a framework in my application the simplest way to do it is simply copy it into the root of my application. My question then is, is it possible to somehow define a dependency which is a collection of files? Also, if I did somehow define that dependency, is there a way to make sure that the dependency is coppied to a specific directory within he webapp? Or, should I be looking at plugins to accomplish this, or something else entirely? Thanks for your help, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836
Re: General questions regarding dependencies
So, I'm getting the impression that the dependencys need to be a single file such as a jar, zip, or something else. I can't have a folder of files as my dependency? This is fine, it seems that dependency or assembly plugin can be used to explode this as needed. Where can I find documentation on creating my own repository and using it with Maven? Thanks, Doug Hughes, President Alagad Inc. dhug...@alagad.com 888 Alagad4 (x300) Office: 919-550-0755 Fax: 888-248-7836 On Fri, May 8, 2009 at 9:28 AM, Graham Leggett minf...@sharp.fm wrote: Doug Hughes wrote: I have some questions about how dependencies are handled within Maven. I understand that when you add a dependency that Maven looks at the central repository, finds the correct files and downloads them. I'm wondering if this can only be done for JAR/WAR files? No, any artifact from your build can be deployed into a maven repository. The maven-rpm-plugin for example creates an RPM file as an artifact, and the maven deploy step will deploy the RPM into a repository, it doesn't have to be a jar or a war (or an ear, or whatever). My question then is, is it possible to somehow define a dependency which is a collection of files? Yes, group the files together into some kind of archive (zip is good, or jar seeing we are in the java universe), and then deploy that. Also, if I did somehow define that dependency, is there a way to make sure that the dependency is coppied to a specific directory within he webapp? Yes. The maven-dependency-plugin can be asked to unpack directories and put them in certain places during your build. Alternatively, for more general purpose stuff, the maven-assembly-plugin can be used to produce an assembly of multiple things combined into a single tree. Regards, Graham --