> Date: Fri, 29 Aug 2014 10:37:49 +0800 > From: tom.w...@embracesource.com > To: users@maven.apache.org > Subject: Re: hi, I just want to get help about maven archetype,please help me > > i can't, i think this parameter is used for generated whole archetype > project but this is not i need. MG>"this is not i need" doesnt provide useful information to diagnose your problem
MG>get the sources straightened out as Herve suggested and MG>__artifactId__ directory will at least contain source and give you a valid starting point MG>get the specs from the project lead : MG>Project1 is supposed to create outputDirectory1 MG>Project2 is supposed to create outputDirectory2 but does not MG>at least that way if you provide all the poms for each Project we can narrow down MG>1)what resource is not being created MG>2)what content if any is not being copied MG>Bon Chance > > > 在 2014-08-21 1:51, Martin Gainty 写道: > > > >> Date: Wed, 20 Aug 2014 10:57:48 +0800 > >> From: tom.w...@embracesource.com > >> To: users@maven.apache.org > >> Subject: Re: hi, I just want to get help about maven archetype,please help > >> me > >> > >> yeah, it works! __artifactId__ and __rootArtifactId__ all works well > >> but this way bring a new little problem: my archetype is come from a > >> demo project using archetype:create-from-project,now i get a archetype > >> and change some directory's name to __artifactId__,later i want to make > >> some tuning on the demo project and call mvn > >> archetype:create-from-project again, then i have to rename those > >> directory's name again. > > MG>can you not specify outputDirectory from archetype:create-project for > > your new outputDirectory? > > MG>http://maven.apache.org/archetype/maven-archetype-plugin/create-from-project-mojo.html > > > >> do you have any suggestions ? why not the archetype plugin put the java > >> sources into right path directly? > >> > >> > >> 在 2014-08-18 19:25, Hervé BOUTEMY 写道: > >>> ah ok > >>> so you don't need a custom plugin to add artifactId: just put content in a > >>> directory named __artifactId__ > >>> > >>> see > >>> http://stackoverflow.com/questions/6378589/how-to-rename-a-directory-with-the-artifactid-when-using-a-maven-archetype > >>> > >>> Regards, > >>> > >>> Hervé > >>> > >>> Le lundi 18 août 2014 17:00:36 TOM a écrit : > >>>> i think i got it,i debuged archetype:generate and found code like this > >>>> > >>>> DefaultFilesetArchetypeGenerator.java > >>>> private File getOutputFile( String template, String directory, File > >>>> outputDirectoryFile, boolean packaged, > >>>> String packageName, String > >>>> moduleOffset, Context context ) > >>>> { > >>>> String templateName = StringUtils.replaceOnce( template, > >>>> directory, "" ); > >>>> > >>>> String outputFileName = > >>>> directory + "/" + ( packaged ? getPackageAsDirectory( > >>>> packageName ) : "" ) + "/" + templateName.substring( > >>>> moduleOffset.length() ); > >>>> > >>>> if ( TOKEN_PATTERN.matcher( outputFileName ).matches() ) > >>>> { > >>>> outputFileName = replaceFilenameTokens( outputFileName, > >>>> context ); > >>>> } > >>>> > >>>> return new File( outputDirectoryFile, outputFileName ); > >>>> } > >>>> > >>>> so maybe archetype plugin doesn't intend deal with the artifactId in the > >>>> path,am i right? > >>>> i wrote a plugin to adjust file path myself > >>>> > >>>> 在 2014-08-18 15:54, Hervé BOUTEMY 写道: > >>>>> ok, need to investigate > >>>>> can you create a Jira issue and attach an example project? > >>>>> > >>>>> Regards, > >>>>> > >>>>> Hervé > >>>>> > >>>>> Le lundi 18 août 2014 10:01:16 TOM a écrit : > >>>>>> thank you ,but my descriptor already is packaged= true > >>>>>> <fileSet filtered="true" packaged="true" encoding="UTF-8"> > >>>>>> > >>>>>> <directory>src/main/java</directory> > >>>>>> <includes> > >>>>>> > >>>>>> <include>**/*.java</include> > >>>>>> > >>>>>> </includes> > >>>>>> > >>>>>> </fileSet> > >>>>>> > >>>>>> 在 2014-08-18 0:10, Hervé BOUTEMY 写道: > >>>>>>> use packaged="true" [1] > >>>>>>> > >>>>>>> Regards, > >>>>>>> > >>>>>>> Hervé > >>>>>>> > >>>>>>> [1] > >>>>>>> http://maven.apache.org/archetype/archetype-models/archetype-descriptor/ > >>>>>>> a > >>>>>>> rchetype-descriptor.html> > >>>>>>> > >>>>>>> Le mardi 12 août 2014 16:58:53 TOM a écrit : > >>>>>>>> I use mvn archetype:create-from-project to generate a archetype > >>>>>>>> project. > >>>>>>>> and use it to generate a project > >>>>>>>> > >>>>>>>> the content of archetype file UserDTO(generaged by > >>>>>>>> archetype:create-from-project) > >>>>>>>> package ${package}.${artifactId}.dto; > >>>>>>>> > >>>>>>>> then i mvn archetype:generate -DarchetypeArtifactId=myapp > >>>>>>>> -DgroupId=test > >>>>>>>> -DartifactId=good > >>>>>>>> > >>>>>>>> then the generated UserDTO with correct package(package > >>>>>>>> test.good.dto), > >>>>>>>> but it is in src/main/java/test/dto , not expected > >>>>>>>> src/main/java/test/good/dto > >>>>>>>> > >>>>>>>> please help me and thank a lot > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> --------------------------------------------------------------------- > >>>>>>>> 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 > >>>>>> --------------------------------------------------------------------- > >>>>>> 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 > >>>> --------------------------------------------------------------------- > >>>> 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 > >>> > >>> > >> > >> --------------------------------------------------------------------- > >> 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 >