You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by tbee <tb...@tbee.org> on 2010/01/30 07:38:17 UTC

pom without artifacts?

I have uploaded a swing look-and-feel to our internal repository. The LaF
contains a main jar plus a separate jar for each skin. In order to minimize
the end result, each skin is uploaded separately with its own pom referring
to the main jar. 

But sometimes I want it all skins, so I figured I create a pom with refers
to all skins (which in turn refer to the main), but does not contain any
artifacts itself. 

I can upload the pom without problems, leaving out the packaging. But when
refering to it, it tries to download "xxx-all.jar", so it assumes a default
packaging.

Is there any way to create such a artifact-less pom?
-- 
View this message in context: http://old.nabble.com/pom-without-artifacts--tp27381618p27381618.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: pom without artifacts?

Posted by Anders Hammar <an...@hammar.net>.
Here are some bood books about Maven:
http://www.sonatype.com/documentation/books

And they are free.

/Anders

On Sun, Jan 31, 2010 at 09:27, tbee <tb...@tbee.org> wrote:

>
>
> Anders Hammar wrote:
> >
> > When you specify 'pom' as package type in a project you mostly konfigure
> > the
> > lifecycle of that project.
> >
> > When in your dependency, you need to specify the type as well ("pom"),
> > otherwise Maven is going to look for a jar dependency.
> >
> > It's two different things. This is just how things work, you need to
> > appreciate that...:-)
> >
>
> Well. Maven is complex to fully understand. It seems to simple at first;
> phases, goals, and there you go. One day I will understand this as well,
> but
> right now I cannot appreciate it :-)
> --
> View this message in context:
> http://old.nabble.com/pom-without-artifacts--tp27381618p27390933.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: pom without artifacts?

Posted by tbee <tb...@tbee.org>.

Anders Hammar wrote:
> 
> When you specify 'pom' as package type in a project you mostly konfigure
> the
> lifecycle of that project.
> 
> When in your dependency, you need to specify the type as well ("pom"),
> otherwise Maven is going to look for a jar dependency.
> 
> It's two different things. This is just how things work, you need to
> appreciate that...:-)
> 

Well. Maven is complex to fully understand. It seems to simple at first;
phases, goals, and there you go. One day I will understand this as well, but
right now I cannot appreciate it :-)
-- 
View this message in context: http://old.nabble.com/pom-without-artifacts--tp27381618p27390933.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: pom without artifacts?

Posted by Anders Hammar <an...@hammar.net>.
When you specify 'pom' as package type in a project you mostly konfigure the
lifecycle of that project.

When in your dependency, you need to specify the type as well ("pom"),
otherwise Maven is going to look for a jar dependency.

It's two different things. This is just how things work, you need to
appreciate that...:-)

/Anders

On Sat, Jan 30, 2010 at 17:39, tbee <tb...@tbee.org> wrote:

>
>
>
> Jörg Schaible-2 wrote:
> >
> > No, it cannot. If you omit the type, it defaults to "jar" and that is a
> > different artifact.
> >
>
> I understand that the PACKAGING type needs to be set to "pom", but I do not
> understand (and that was my error) that the DEPENDENCY type, so the other
> side of the relation, also must be set to "pom".
>
>
> --
> View this message in context:
> http://old.nabble.com/pom-without-artifacts--tp27381618p27385253.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: pom without artifacts?

Posted by tbee <tb...@tbee.org>.


Jörg Schaible-2 wrote:
> 
> No, it cannot. If you omit the type, it defaults to "jar" and that is a 
> different artifact.
> 

I understand that the PACKAGING type needs to be set to "pom", but I do not
understand (and that was my error) that the DEPENDENCY type, so the other
side of the relation, also must be set to "pom".


-- 
View this message in context: http://old.nabble.com/pom-without-artifacts--tp27381618p27385253.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: pom without artifacts?

Posted by Jörg Schaible <jo...@gmx.de>.
tbee wrote:

> 
> 
> 
> Anders Hammar wrote:
>> 
>> If you want a pom project,
>> you MUST specify 'pom' as package type.
>> 
> 
> The problem was that one also needs to specify "pom" as the type in the
> dependency (see your link, thanks!). That is strange; it can derrive that
> from packaging type in the referred pom.

No, it cannot. If you omit the type, it defaults to "jar" and that is a 
different artifact.

- Jörg


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


Re: pom without artifacts?

Posted by tbee <tb...@tbee.org>.


Anders Hammar wrote:
> 
> If you want a pom project,
> you MUST specify 'pom' as package type.
> 

The problem was that one also needs to specify "pom" as the type in the
dependency (see your link, thanks!). That is strange; it can derrive that
from packaging type in the referred pom.

-- 
View this message in context: http://old.nabble.com/pom-without-artifacts--tp27381618p27383694.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: pom without artifacts?

Posted by Anders Hammar <an...@hammar.net>.
Yes, that's how to do it. Maven is based around the concept of convention
over configuration. If you don't specify the package type, it defaults to
'jar'. That's the behavior you're experiencing. If you want a pom project,
you MUST specify 'pom' as package type.

What you're trying to do is what sometimes referred to grouped dependencies.
Read more about there here and please understand the drawbacks:
http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-grouping-dependencies/

/Anders

On Sat, Jan 30, 2010 at 09:14, eyal edri <ey...@gmail.com> wrote:

> what about setting the packaing to "pom" instead of "jar" ?
>
> On Sat, Jan 30, 2010 at 8:38 AM, tbee <tb...@tbee.org> wrote:
>
> >
> > I have uploaded a swing look-and-feel to our internal repository. The LaF
> > contains a main jar plus a separate jar for each skin. In order to
> minimize
> > the end result, each skin is uploaded separately with its own pom
> referring
> > to the main jar.
> >
> > But sometimes I want it all skins, so I figured I create a pom with
> refers
> > to all skins (which in turn refer to the main), but does not contain any
> > artifacts itself.
> >
> > I can upload the pom without problems, leaving out the packaging. But
> when
> > refering to it, it tries to download "xxx-all.jar", so it assumes a
> default
> > packaging.
> >
> > Is there any way to create such a artifact-less pom?
> > --
> > View this message in context:
> > http://old.nabble.com/pom-without-artifacts--tp27381618p27381618.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Eyal Edri
>

Re: pom without artifacts?

Posted by Anders Hammar <an...@hammar.net>.
It should be type "pom".

On Sat, Jan 30, 2010 at 13:08, Anders Hammar <an...@hammar.net> wrote:

> You need to define type om in your dependency.
> Please read the bog post I linked to in my earlier response!
>
> /Anders
>
>
> On Sat, Jan 30, 2010 at 13:03, tbee <tb...@tbee.org> wrote:
>
>>
>>
>>
>> Alexander-129 wrote:
>> >
>> > You are defining this pom project as dependency in module? Right?
>> >
>>
>> I have a series of POM + JARs uploaded to Nexus, e.g.
>> - xxx-1.1.jar
>> - xxx-skinA-1.1.jar
>> - xxx-skinB-1.1.jar
>> - xxx-skinC-1.1.jar
>>
>> This works fine. Now I want a "xxx-all:1.1" pom which will download the
>> whole bunch above.
>> In a project I indeed have a denpendency:
>>   ... <artifactId>xxx-all</artifactId><version>1.1</version>
>>
>> When resolving that project it tries to download "xxx-all-1.1.jar" and
>> fails
>> on a missing dependency.
>>
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/pom-without-artifacts--tp27381618p27383258.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: pom without artifacts?

Posted by Anders Hammar <an...@hammar.net>.
You need to define type om in your dependency.
Please read the bog post I linked to in my earlier response!

/Anders

On Sat, Jan 30, 2010 at 13:03, tbee <tb...@tbee.org> wrote:

>
>
>
> Alexander-129 wrote:
> >
> > You are defining this pom project as dependency in module? Right?
> >
>
> I have a series of POM + JARs uploaded to Nexus, e.g.
> - xxx-1.1.jar
> - xxx-skinA-1.1.jar
> - xxx-skinB-1.1.jar
> - xxx-skinC-1.1.jar
>
> This works fine. Now I want a "xxx-all:1.1" pom which will download the
> whole bunch above.
> In a project I indeed have a denpendency:
>   ... <artifactId>xxx-all</artifactId><version>1.1</version>
>
> When resolving that project it tries to download "xxx-all-1.1.jar" and
> fails
> on a missing dependency.
>
>
>
> --
> View this message in context:
> http://old.nabble.com/pom-without-artifacts--tp27381618p27383258.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: pom without artifacts?

Posted by Alexander <th...@gmail.com>.
Use project inheritance, not as dependency

On 30 January 2010 18:09, eyal edri <ey...@gmail.com> wrote:

> you can using the "copy-dependencies" goal of the dependency plugin.
>
> <project>
>  [...]
>  <build>
>    <plugins>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>
>        <artifactId>maven-dependency-plugin</artifactId>
>        <executions>
>          <execution>
>            <id>copy-dependencies</id>
>            <phase>package</phase>
>
>            <goals>
>              <goal>copy-dependencies</goal>
>            </goals>
>            <configuration>
>              <!-- configure the plugin here -->
>            </configuration>
>
>          </execution>
>        </executions>
>      </plugin>
>    </plugins>
>  </build>
>  [...]
> </project>
>
>
> i used it in my project.
>
> On Sat, Jan 30, 2010 at 2:03 PM, tbee <tb...@tbee.org> wrote:
>
> >
> >
> >
> > Alexander-129 wrote:
> > >
> > > You are defining this pom project as dependency in module? Right?
> > >
> >
> > I have a series of POM + JARs uploaded to Nexus, e.g.
> > - xxx-1.1.jar
> > - xxx-skinA-1.1.jar
> > - xxx-skinB-1.1.jar
> > - xxx-skinC-1.1.jar
> >
> > This works fine. Now I want a "xxx-all:1.1" pom which will download the
> > whole bunch above.
> > In a project I indeed have a denpendency:
> >   ... <artifactId>xxx-all</artifactId><version>1.1</version>
> >
> > When resolving that project it tries to download "xxx-all-1.1.jar" and
> > fails
> > on a missing dependency.
> >
> >
> >
> > --
> > View this message in context:
> > http://old.nabble.com/pom-without-artifacts--tp27381618p27383258.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Eyal Edri
>



-- 
Regards,
Alexander

Re: pom without artifacts?

Posted by eyal edri <ey...@gmail.com>.
you can using the "copy-dependencies" goal of the dependency plugin.

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>package</phase>

            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <!-- configure the plugin here -->
            </configuration>

          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>


i used it in my project.

On Sat, Jan 30, 2010 at 2:03 PM, tbee <tb...@tbee.org> wrote:

>
>
>
> Alexander-129 wrote:
> >
> > You are defining this pom project as dependency in module? Right?
> >
>
> I have a series of POM + JARs uploaded to Nexus, e.g.
> - xxx-1.1.jar
> - xxx-skinA-1.1.jar
> - xxx-skinB-1.1.jar
> - xxx-skinC-1.1.jar
>
> This works fine. Now I want a "xxx-all:1.1" pom which will download the
> whole bunch above.
> In a project I indeed have a denpendency:
>   ... <artifactId>xxx-all</artifactId><version>1.1</version>
>
> When resolving that project it tries to download "xxx-all-1.1.jar" and
> fails
> on a missing dependency.
>
>
>
> --
> View this message in context:
> http://old.nabble.com/pom-without-artifacts--tp27381618p27383258.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eyal Edri

Re: pom without artifacts?

Posted by tbee <tb...@tbee.org>.


Alexander-129 wrote:
> 
> You are defining this pom project as dependency in module? Right?
> 

I have a series of POM + JARs uploaded to Nexus, e.g.
- xxx-1.1.jar
- xxx-skinA-1.1.jar
- xxx-skinB-1.1.jar
- xxx-skinC-1.1.jar

This works fine. Now I want a "xxx-all:1.1" pom which will download the
whole bunch above. 
In a project I indeed have a denpendency:
   ... <artifactId>xxx-all</artifactId><version>1.1</version>

When resolving that project it tries to download "xxx-all-1.1.jar" and fails
on a missing dependency.



-- 
View this message in context: http://old.nabble.com/pom-without-artifacts--tp27381618p27383258.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: pom without artifacts?

Posted by Alexander <th...@gmail.com>.
You are defining this pom project as dependency in module? Right?

On 30 January 2010 17:00, tbee <tb...@tbee.org> wrote:

>
>
>
> Tranquil wrote:
> >
> > what about setting the packaing to "pom" instead of "jar" ?
> >
>
> No, it keeps trying to download xxx-all:jar:2.9.1
> The artifact id is "xxx-all".
>
>
> --
> View this message in context:
> http://old.nabble.com/pom-without-artifacts--tp27381618p27382885.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Regards,
Alexander

Re: pom without artifacts?

Posted by tbee <tb...@tbee.org>.


Tranquil wrote:
> 
> what about setting the packaing to "pom" instead of "jar" ?
> 

No, it keeps trying to download xxx-all:jar:2.9.1
The artifact id is "xxx-all".


-- 
View this message in context: http://old.nabble.com/pom-without-artifacts--tp27381618p27382885.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: pom without artifacts?

Posted by eyal edri <ey...@gmail.com>.
what about setting the packaing to "pom" instead of "jar" ?

On Sat, Jan 30, 2010 at 8:38 AM, tbee <tb...@tbee.org> wrote:

>
> I have uploaded a swing look-and-feel to our internal repository. The LaF
> contains a main jar plus a separate jar for each skin. In order to minimize
> the end result, each skin is uploaded separately with its own pom referring
> to the main jar.
>
> But sometimes I want it all skins, so I figured I create a pom with refers
> to all skins (which in turn refer to the main), but does not contain any
> artifacts itself.
>
> I can upload the pom without problems, leaving out the packaging. But when
> refering to it, it tries to download "xxx-all.jar", so it assumes a default
> packaging.
>
> Is there any way to create such a artifact-less pom?
> --
> View this message in context:
> http://old.nabble.com/pom-without-artifacts--tp27381618p27381618.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eyal Edri