I was able to solve this by changing from maven-archetype-core to archetype-common and using the new API. Full changelog on moving from old to new is at:
http://source.appfuse.org/changelog/appfuse/?cs=3228 mgainty wrote: > > > Encountered: <EOF> after : "" means you have a null value followed by EOF > when reading the xml > Here are the examples I have seen for getTestFile > File f1 = getTestFile( > "src/test/resources/projects/grandchild-check/child/pom.xml"); > getProject( f1 ); > //The key is to acquire the pom.xml > > If you are getting Security permissions try using > filename.getCanonicalFile() > http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#getCanonicalFile() > > does this help? > Martin > ______________________________________________ > 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: Mon, 27 Apr 2009 14:36:13 -0700 >> From: m...@raibledesigns.com >> To: users@maven.apache.org >> Subject: Re: Is it possible to add files to an archetype from other >> directories? >> >> >> I was able to code a workaround using Ant to create the project then >> "archetype:create-from-project" to create it. The nice thing about using >> Ant >> to do this was I was also able to modify errors in the create process to >> make working archetypes. >> >> After doing this, I've discovered that the code I was using to >> materialize >> archetypes automatically no longer works. The code is below and the error >> I'm experiencing is as follows: >> >> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) >> at >> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) >> Caused by: org.apache.velocity.exception.ParseErrorException: Lexical >> error: >> org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line >> 102, >> column 93. Encountered: <EOF> after : "" >> at org.apache.velocity.Template.process(Template.java:141) >> at >> org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:423) >> at >> org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:341) >> at >> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831) >> at >> org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:440) >> at >> org.apache.maven.archetype.DefaultArchetype.processTemplate(DefaultArchetype.java:904) >> >> >> protected void createTestProject(String archetypeArtifactId, String >> archetypeVersion) throws Exception { >> MavenProject project = getMavenProject(); >> FileUtils.deleteDirectory(getTestFile("target/" + >> project.getArtifactId())); >> >> Map<String, String> parameters = new HashMap<String, String>(); >> >> parameters.put("groupId", project.getGroupId()); >> parameters.put("artifactId", project.getArtifactId()); >> parameters.put("version", "1.0-SNAPSHOT"); >> parameters.put("basedir", >> getTestFile("target").getAbsolutePath()); >> >> Archetype archetype = (Archetype) lookup(Archetype.ROLE); >> >> ArtifactRepositoryLayout layout = >> (ArtifactRepositoryLayout) >> container.lookup(ArtifactRepositoryLayout.ROLE, "default"); >> >> String mavenRepoLocal = "file://" + >> System.getProperty("user.home") >> + System.getProperty("file.separator") + >> ".m2" + System.getProperty("file.separator") + >> "repository"; >> ArtifactRepository localRepository = new >> DefaultArtifactRepository("local", mavenRepoLocal, layout); >> >> List<ArtifactRepository> remoteRepositories = new >> ArrayList<ArtifactRepository>(); >> /*String mavenRepoRemote = "http://repo1.maven.org/maven2"; >> ArtifactRepository remoteRepository = new >> DefaultArtifactRepository("remote", mavenRepoRemote, layout); >> >> remoteRepositories.add(remoteRepository);*/ >> >> String archetypeGroupId = "org.appfuse.archetypes"; >> archetype.createArchetype(archetypeGroupId, archetypeArtifactId, >> archetypeVersion, localRepository, >> remoteRepositories, parameters); >> } >> >> Any ideas? >> >> Thanks, >> >> Matt >> >> Grant Rettke wrote: >> > >> > On Fri, Apr 24, 2009 at 4:24 AM, mraible <m...@raibledesigns.com> >> wrote: >> >> I'd like to hand-craft an archetype that consists of a single pom.xml >> and >> >> pulls it's sources from other modules/directories in my project. Is >> that >> >> possible? >> > >> > That seems to go against the grain of Maven. >> > >> > Does Maven make stuff like this easy? >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> > For additional commands, e-mail: users-h...@maven.apache.org >> > >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Is-it-possible-to-add-files-to-an-archetype-from-other-directories--tp23212840p23265718.html >> Sent from the Maven - Users mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> > > _________________________________________________________________ > Rediscover Hotmail®: Get quick friend updates right in your inbox. > http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Updates2_042009 > -- View this message in context: http://www.nabble.com/Is-it-possible-to-add-files-to-an-archetype-from-other-directories--tp23212840p23266743.html Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org