You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Ferguson, Jason M TSgt 375 CSPTS/SCE" <ja...@scott.af.mil> on 2007/06/28 16:01:22 UTC

Using Maven to Rename a Package

Sorry, I'm a newbie at Maven 2, I admit it.
 
I have a project template that I use for all new development projects.
 
The package directory (under the java directory) will look like this:
 
org.jason.sample.dao
org.jason.sample.service
org.jason.sample.model
org.jason.sample.web
(etc)
 
My test directory will look similar to the java directory (along with
resources and test-resources, etc).
 
Since the packages under sample (dao, service, etc) are not empty, I
need them as part of a Maven archetype.
 
However, I want to rename "sample" to something more descriptive (such
as "photogallery" or something like that).
 
Is there a simple way to have Maven rename "sample"?
 
Jason

Re: Using Maven to Rename a Package

Posted by Steven Rowe <sa...@syr.edu>.
Hi Jason,

Ferguson, Jason M TSgt 375 CSPTS/SCE wrote:
> 		<executions>
> 		  <execution>
> 			<phase>initialize</phase>
> 			<configuration>
> 			<goals>
> 			   <goal>run</goal>
> 			</goals>

The <goals> tag should not be inside the <configuration> - move the
<configuration> tag below the </goals> line, and you should be set.

Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Using Maven to Rename a Package

Posted by "Ferguson, Jason M TSgt 375 CSPTS/SCE" <ja...@scott.af.mil>.
Tim,

I haven't gotten all the way there yet, but I was looking at doing this
with an Ant script using the antrun module.

My build section looks like this:

    <build>

	<plugins>
		<plugin>
		<artifactId>maven-antrun-plugin</artifactId>
		<executions>
		  <execution>
			<phase>initialize</phase>
			<configuration>
			<goals>
			   <goal>run</goal>
			</goals>
			   <tasks>
				<echo>Renaming Sample Project</echo>
				<move
todir="${basedir}/src/java/mil/af/amc/${pom.artifactId}">
				   <fileset
dir="${basedir}/src/java/mil/af/amc/sample" />
				</move>
				<move
todir="${basedir}/test/java/mil/af/amc/${pom.artifactId}">
				   <fileset
dir="${basedir}/test/java/mil/af/amc/sample" />
				</move>
			   </tasks>
			</configuration>

		  </execution>
		</executions>
		</plugin>
	</plugins>
		


        <sourceDirectory>${basedir}/src/java</sourceDirectory>

    </build>

Unfortunately, it didn't work, and I never learned Ant (by the time I
trained as a programmer, the programming shop had converted to Maven).

Can anyone tell me if anything is obviously wrong with that? I try
running "mvn initialize" and get some sort of "no goals" error.

Jason 

-----Original Message-----
From: Tim Kettler [mailto:tim.kettler@udo.edu] 
Sent: Friday, June 29, 2007 12:55 AM
To: Maven Users List
Subject: Re: Using Maven to Rename a Package

Hi,

as far as I can tell you can't do this with the current archetype
plugin. However, there is currently a successor in development over at
the mojo project that should support this kind of things.

Currently no website is set up for it and I can't tell if there are any
binary releases of it.  Your best option probably is to just check out
the sources[1] and try if it does what you need.

-Tim

[1]
https://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/maven-archetypeng/

Ferguson, Jason M TSgt 375 CSPTS/SCE schrieb:
> Sorry, I'm a newbie at Maven 2, I admit it.
>  
> I have a project template that I use for all new development projects.
>  
> The package directory (under the java directory) will look like this:
>  
> org.jason.sample.dao
> org.jason.sample.service
> org.jason.sample.model
> org.jason.sample.web
> (etc)
>  
> My test directory will look similar to the java directory (along with 
> resources and test-resources, etc).
>  
> Since the packages under sample (dao, service, etc) are not empty, I 
> need them as part of a Maven archetype.
>  
> However, I want to rename "sample" to something more descriptive (such

> as "photogallery" or something like that).
>  
> Is there a simple way to have Maven rename "sample"?
>  
> Jason
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Using Maven to Rename a Package

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

as far as I can tell you can't do this with the current archetype 
plugin. However, there is currently a successor in development over at 
the mojo project that should support this kind of things.

Currently no website is set up for it and I can't tell if there are any 
binary releases of it.  Your best option probably is to just check out 
the sources[1] and try if it does what you need.

-Tim

[1] https://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/maven-archetypeng/

Ferguson, Jason M TSgt 375 CSPTS/SCE schrieb:
> Sorry, I'm a newbie at Maven 2, I admit it.
>  
> I have a project template that I use for all new development projects.
>  
> The package directory (under the java directory) will look like this:
>  
> org.jason.sample.dao
> org.jason.sample.service
> org.jason.sample.model
> org.jason.sample.web
> (etc)
>  
> My test directory will look similar to the java directory (along with
> resources and test-resources, etc).
>  
> Since the packages under sample (dao, service, etc) are not empty, I
> need them as part of a Maven archetype.
>  
> However, I want to rename "sample" to something more descriptive (such
> as "photogallery" or something like that).
>  
> Is there a simple way to have Maven rename "sample"?
>  
> Jason
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org