The book is wrong. "-DpackageName=org.XXX.mavenbook" should be
"-Dpackage=org.XXX.mavenbook".
Please help improving the book by creating a jira for this!
https://issues.sonatype.org/

/Anders

On Wed, Dec 9, 2009 at 19:24, nklein <norman.kl...@gmail.com> wrote:

>
> I'm reading the Maven: Definitive Guide book to set up a project. In this
> example from the book, I would like to change the packageName setting to
> "XXX" as seen below:
>
> mvn archetype:generate \
> -DgroupId=org.sonatype.mavenbook \
> -DartifactId=quickstart \
> -Dversion=1.0-SNAPSHOT \
> -DpackageName=org.XXX.mavenbook \
> -DarchetypeGroupId=org.apache.maven.archetypes \
> -DarchetypeArtifactId=maven-archetype-quickstart \
> -DarchetypeVersion=1.0 \
> -DinteractiveMode=false
>
> But mvn produces the following output:
>
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'archetype'.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Maven Default Project
> [INFO]    task-segment: [archetype:generate] (aggregator-style)
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Preparing archetype:generate
> [INFO] No goals needed for project - skipping
> [INFO] Setting property: classpath.resource.loader.class =>
> 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
> [INFO] Setting property: velocimacro.messages.on => 'false'.
> [INFO] Setting property: resource.loader => 'classpath'.
> [INFO] Setting property: resource.manager.logwhenfound => 'false'.
> [INFO] [archetype:generate {execution: default-cli}]
> [INFO] Generating project in Batch mode
> [INFO] Archetype repository missing. Using the one from
> [org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE] found in
> catalog internal
> [INFO]
>
> ----------------------------------------------------------------------------
> [INFO] Using following parameters for creating OldArchetype:
> maven-archetype-quickstart:1.0
> [INFO]
>
> ----------------------------------------------------------------------------
> [INFO] Parameter: groupId, Value: org.sonatype.mavenbook
> [INFO] Parameter: packageName, Value: org.sonatype.mavenbook
> [INFO] Parameter: package, Value: org.sonatype.mavenbook
> [INFO] Parameter: artifactId, Value: quickstart
> [INFO] Parameter: basedir, Value: c:\Temp
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO] ********************* End of debug info from resources from
> generated
> POM ***********************
> [INFO] OldArchetype created in dir: c:\Temp\quickstart
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 1 second
> [INFO] Finished at: Wed Dec 09 10:22:44 PST 2009
> [INFO] Final Memory: 8M/14M
> [INFO]
> ------------------------------------------------------------------------
>
> The packageName doesn't conform to the overridden value supplied on the
> command line. Do I understand the purpose of the packageName correctly? I
> thought it allowed users to override the default value to supply a project
> specific value.
>
> Thanks.
> --
> View this message in context:
> http://old.nabble.com/Can%27t-change-packageName-tp26715082p26715082.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
>
>

Reply via email to