You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Petr V." <gr...@yahoo.com> on 2008/10/25 03:39:41 UTC
packaging statement does not get in pom file
Hi All,
I am trying to create new project from scratch using maven.
Lets assume my desired dir structure is
project
-----main
----mod1
I am issuing following commands from command prompt :
c:\project\ >mvn archetype:create -DgroupId=com.company.project -DartifactId=main
Then I get the whole maven dir structure created for project
But
I want main to have packaging of type "pom" but by default, it defines
packaging type as "jar" . I manually over write it "pom" and delete
whole src dir because main would not have any src dir in itself. Can I
issue some command to ask maven to define packaging of type pom and not
create src dir at all in first place.
Now I go to main dir and issue following command
c:\project\main >mvn archetype:create -DgroupId=com.company.project -DartifactId=mod1
Now
the whole structure is created for mod1 but the pom file does not
define packaging type at all :-( . Though it adds parent detail in pom
file and also add module detail in pom file of main's pom file. How can
I ask maven to add packaging statement with "jar"
Any help would be really really appreciated.
Have a great week end.
Thanks,
Petr
Re: packaging statement does not get in pom file
Posted by Wendy Smoak <ws...@gmail.com>.
On Fri, Oct 24, 2008 at 6:39 PM, Petr V. <gr...@yahoo.com> wrote:
> I am issuing following commands from command prompt :
> c:\project\ >mvn archetype:create -DgroupId=com.company.project -DartifactId=main
> Then I get the whole maven dir structure created for project
>
> But
> I want main to have packaging of type "pom" but by default, it defines
> packaging type as "jar"
I don't think there's an archetype for a pom type project. It's come
up before though, maybe there should be. I usually just copy one from
another project and edit it. All you need is:
<project ... >
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>myproject</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
</project>
> Now I go to main dir and issue following command
> c:\project\main >mvn archetype:create -DgroupId=com.company.project -DartifactId=mod1
>
> Now
> the whole structure is created for mod1 but the pom file does not
> define packaging type at all :-( . Though it adds parent detail in pom
> file and also add module detail in pom file of main's pom file. How can
> I ask maven to add packaging statement with "jar"
It's interesting that it includes packaging when you use the archetype
to create a standalone project but not if you use it to create a child
project. However, packaging of jar is the default, so you don't have
to specify it. (Try removing <packaging> from the standalone
project-- mvn install will still work.)
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org