You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andreas Ebbert-Karroum <eb...@codecentric.de> on 2009/11/25 13:52:33 UTC

filter resources with version of a certain dependency

Hi,

is it possible to use version information of a certain dependency for resource filtering?

Use-Case is that we have a content management system that needs the dependency information in another format than the pom.xml, and we would like to automate that. So the question is, can we use properties like this ${project.dependency(groupId=abc, artifactId=xzy).version}. I am sure that this XML Path like syntax does not work, but to give you an idea what I mean. Actually, it would be nice, if this syntax worked ;)

Mit freundlichen Grüßen / Best regards


Andreas Ebbert-Karroum
Teamleiter Softwareentwicklung




codecentric GmbH, Merscheider Str. 1, 42699 Solingen

Büro: +49 (0) 212 233628-25, Mobil: +49 (0) 175 2664109, Fax: +49 (0) 212 233628-79

Internet:           www.codecentric.de<http://www.codecentric.de>
Blog:                blog.codecentric.de<http://blog.codecentric.de>

Geschäftsführer: Mirko Novakovic und Rainer Vehns
Sitz der Gesellschaft: Solingen
Registergericht: Amtsgericht Wuppertal, HRB 19214

Diese E-Mail einschließlich evtl. angehängter Dateien enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und löschen Sie diese E-Mail und evtl. anhängende Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl. anhängender Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.


RE: filter resources with version of a certain dependency

Posted by Andreas Ebbert-Karroum <eb...@codecentric.de>.
Hi Anders,

thanks for sharing your idea, which is really interesting. It tells me that at least the information is available, but not accessible with the standard maven property resolution algorithm. Would be interesting to find out if it can be easily patched it. 

Let's see where in the maven source code that logic is hidden :)


Mit freundlichen Grüßen / Best regards


Andreas Ebbert-Karroum
Teamleiter Softwareentwicklung


        
        
codecentric GmbH, Merscheider Str. 1, 42699 Solingen

Büro: +49 (0) 212 233628-25, Mobil: +49 (0) 175 2664109, Fax: +49 (0) 212 233628-79

Internet: 	www.codecentric.de
Blog:		blog.codecentric.de
	
Geschäftsführer: Mirko Novakovic und Rainer Vehns
Sitz der Gesellschaft: Solingen
Registergericht: Amtsgericht Wuppertal, HRB 19214

Diese E-Mail einschließlich evtl. angehängter Dateien enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und löschen Sie diese E-Mail und evtl. anhängende Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl. anhängender Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.




> -----Original Message-----
> From: Anders Hammar [mailto:anders@hammar.net]
> Sent: Monday, November 30, 2009 11:04 AM
> To: Maven Users List
> Subject: Re: filter resources with version of a certain dependency
> 
> I think that you can get the version of a specific dependency through
> Groovy
> script by using the groovy-maven-plugin. Not sure if you can set a maven
> property from a groovy script though. Tried to find any good docs on the
> plugin but couldn't, sorry.
> 
> Some example config for that plugin that loops the dependencies:
> <configuration>
> <source>
> println "Hi there I am in ${project.name} version ${project.version}
> project.dependencies.each {
> println "Group: $it.groupId; Artifact: $it.artifactId; Version:
> $it.version"
> }
> </source>
> </configuration>
> 
> Maybe you're better off writing your own plugin for your specific need?
> 
> /Anders
> 
> 2009/11/30 Andreas Ebbert-Karroum <eb...@codecentric.de>
> 
> > Hi,
> >
> > when I don't receive a reply on a question, I'm always uncertain what the
> > reason for that is:
> >
> > * Was the question or problem unclear?
> > * Is the answer so obvious that nobody cares to reply?
> > * Is the answer so difficult, or the solution impossible without
> inventing
> > something new, that nobody says: at the moment not possible
> > * Is there another way of doing it, that I am not aware of, so that
> others
> > never had the problem before.
> >
> > Besides ... if anybody has any opinion on how to get the version of a
> known
> > dependency as a maven property, please let me know.
> >
> >
> > Mit freundlichen Grüßen / Best regards
> >
> >
> > Andreas Ebbert-Karroum
> > Teamleiter Softwareentwicklung
> >
> >
> >
> >
> > codecentric GmbH, Merscheider Str. 1, 42699 Solingen
> >
> > Büro: +49 (0) 212 233628-25, Mobil: +49 (0) 175 2664109, Fax: +49 (0) 212
> > 233628-79
> >
> > Internet:       www.codecentric.de
> > Blog:           blog.codecentric.de
> >
> > Geschäftsführer: Mirko Novakovic und Rainer Vehns
> > Sitz der Gesellschaft: Solingen
> > Registergericht: Amtsgericht Wuppertal, HRB 19214
> >
> > Diese E-Mail einschließlich evtl. angehängter Dateien enthält
> vertrauliche
> > und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige
> > Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren
> Sie
> > bitte sofort den Absender und löschen Sie diese E-Mail und evtl.
> anhängende
> > Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl.
> > anhängender Dateien sowie die unbefugte Weitergabe dieser E-Mail ist
> nicht
> > gestattet.
> >
> >
> >
> > > -----Original Message-----
> > > From: Andreas Ebbert-Karroum [mailto:ebbert-karroum@codecentric.de]
> > > Sent: Wednesday, November 25, 2009 1:53 PM
> > > To: Maven Users List
> > > Subject: filter resources with version of a certain dependency
> > >
> > > Hi,
> > >
> > > is it possible to use version information of a certain dependency for
> > > resource filtering?
> > >
> > > Use-Case is that we have a content management system that needs the
> > > dependency information in another format than the pom.xml, and we would
> > > like to automate that. So the question is, can we use properties like
> > this
> > > ${project.dependency(groupId=abc, artifactId=xzy).version}. I am sure
> > that
> > > this XML Path like syntax does not work, but to give you an idea what I
> > > mean. Actually, it would be nice, if this syntax worked ;)
> > >
> > > Mit freundlichen Grüßen / Best regards
> > >
> > >
> > > Andreas Ebbert-Karroum
> > > Teamleiter Softwareentwicklung
> > >
> > >
> > >
> > >
> > > codecentric GmbH, Merscheider Str. 1, 42699 Solingen
> > >
> > > Büro: +49 (0) 212 233628-25, Mobil: +49 (0) 175 2664109, Fax: +49 (0)
> 212
> > > 233628-79
> > >
> > > Internet:           www.codecentric.de<http://www.codecentric.de>
> > > Blog:                blog.codecentric.de<http://blog.codecentric.de>
> > >
> > > Geschäftsführer: Mirko Novakovic und Rainer Vehns
> > > Sitz der Gesellschaft: Solingen
> > > Registergericht: Amtsgericht Wuppertal, HRB 19214
> > >
> > > Diese E-Mail einschließlich evtl. angehängter Dateien enthält
> > vertrauliche
> > > und/oder rechtlich geschützte Informationen. Wenn Sie nicht der
> richtige
> > > Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren
> > Sie
> > > bitte sofort den Absender und löschen Sie diese E-Mail und evtl.
> > anhängende
> > > Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl.
> > > anhängender Dateien sowie die unbefugte Weitergabe dieser E-Mail ist
> > nicht
> > > gestattet.
> >
> >
> > ---------------------------------------------------------------------
> > 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: filter resources with version of a certain dependency

Posted by Anders Hammar <an...@hammar.net>.
I think that you can get the version of a specific dependency through Groovy
script by using the groovy-maven-plugin. Not sure if you can set a maven
property from a groovy script though. Tried to find any good docs on the
plugin but couldn't, sorry.

Some example config for that plugin that loops the dependencies:
<configuration>
<source>
println "Hi there I am in ${project.name} version ${project.version}
project.dependencies.each {
println "Group: $it.groupId; Artifact: $it.artifactId; Version: $it.version"
}
</source>
</configuration>

Maybe you're better off writing your own plugin for your specific need?

/Anders

2009/11/30 Andreas Ebbert-Karroum <eb...@codecentric.de>

> Hi,
>
> when I don't receive a reply on a question, I'm always uncertain what the
> reason for that is:
>
> * Was the question or problem unclear?
> * Is the answer so obvious that nobody cares to reply?
> * Is the answer so difficult, or the solution impossible without inventing
> something new, that nobody says: at the moment not possible
> * Is there another way of doing it, that I am not aware of, so that others
> never had the problem before.
>
> Besides ... if anybody has any opinion on how to get the version of a known
> dependency as a maven property, please let me know.
>
>
> Mit freundlichen Grüßen / Best regards
>
>
> Andreas Ebbert-Karroum
> Teamleiter Softwareentwicklung
>
>
>
>
> codecentric GmbH, Merscheider Str. 1, 42699 Solingen
>
> Büro: +49 (0) 212 233628-25, Mobil: +49 (0) 175 2664109, Fax: +49 (0) 212
> 233628-79
>
> Internet:       www.codecentric.de
> Blog:           blog.codecentric.de
>
> Geschäftsführer: Mirko Novakovic und Rainer Vehns
> Sitz der Gesellschaft: Solingen
> Registergericht: Amtsgericht Wuppertal, HRB 19214
>
> Diese E-Mail einschließlich evtl. angehängter Dateien enthält vertrauliche
> und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige
> Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie
> bitte sofort den Absender und löschen Sie diese E-Mail und evtl. anhängende
> Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl.
> anhängender Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht
> gestattet.
>
>
>
> > -----Original Message-----
> > From: Andreas Ebbert-Karroum [mailto:ebbert-karroum@codecentric.de]
> > Sent: Wednesday, November 25, 2009 1:53 PM
> > To: Maven Users List
> > Subject: filter resources with version of a certain dependency
> >
> > Hi,
> >
> > is it possible to use version information of a certain dependency for
> > resource filtering?
> >
> > Use-Case is that we have a content management system that needs the
> > dependency information in another format than the pom.xml, and we would
> > like to automate that. So the question is, can we use properties like
> this
> > ${project.dependency(groupId=abc, artifactId=xzy).version}. I am sure
> that
> > this XML Path like syntax does not work, but to give you an idea what I
> > mean. Actually, it would be nice, if this syntax worked ;)
> >
> > Mit freundlichen Grüßen / Best regards
> >
> >
> > Andreas Ebbert-Karroum
> > Teamleiter Softwareentwicklung
> >
> >
> >
> >
> > codecentric GmbH, Merscheider Str. 1, 42699 Solingen
> >
> > Büro: +49 (0) 212 233628-25, Mobil: +49 (0) 175 2664109, Fax: +49 (0) 212
> > 233628-79
> >
> > Internet:           www.codecentric.de<http://www.codecentric.de>
> > Blog:                blog.codecentric.de<http://blog.codecentric.de>
> >
> > Geschäftsführer: Mirko Novakovic und Rainer Vehns
> > Sitz der Gesellschaft: Solingen
> > Registergericht: Amtsgericht Wuppertal, HRB 19214
> >
> > Diese E-Mail einschließlich evtl. angehängter Dateien enthält
> vertrauliche
> > und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige
> > Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren
> Sie
> > bitte sofort den Absender und löschen Sie diese E-Mail und evtl.
> anhängende
> > Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl.
> > anhängender Dateien sowie die unbefugte Weitergabe dieser E-Mail ist
> nicht
> > gestattet.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: filter resources with version of a certain dependency

Posted by Andreas Ebbert-Karroum <eb...@codecentric.de>.
Hi,

when I don't receive a reply on a question, I'm always uncertain what the reason for that is:

* Was the question or problem unclear?
* Is the answer so obvious that nobody cares to reply?
* Is the answer so difficult, or the solution impossible without inventing something new, that nobody says: at the moment not possible
* Is there another way of doing it, that I am not aware of, so that others never had the problem before.

Besides ... if anybody has any opinion on how to get the version of a known dependency as a maven property, please let me know.


Mit freundlichen Grüßen / Best regards


Andreas Ebbert-Karroum
Teamleiter Softwareentwicklung


        
        
codecentric GmbH, Merscheider Str. 1, 42699 Solingen

Büro: +49 (0) 212 233628-25, Mobil: +49 (0) 175 2664109, Fax: +49 (0) 212 233628-79

Internet: 	www.codecentric.de
Blog:		blog.codecentric.de
	
Geschäftsführer: Mirko Novakovic und Rainer Vehns
Sitz der Gesellschaft: Solingen
Registergericht: Amtsgericht Wuppertal, HRB 19214

Diese E-Mail einschließlich evtl. angehängter Dateien enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und löschen Sie diese E-Mail und evtl. anhängende Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl. anhängender Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.



> -----Original Message-----
> From: Andreas Ebbert-Karroum [mailto:ebbert-karroum@codecentric.de]
> Sent: Wednesday, November 25, 2009 1:53 PM
> To: Maven Users List
> Subject: filter resources with version of a certain dependency
> 
> Hi,
> 
> is it possible to use version information of a certain dependency for
> resource filtering?
> 
> Use-Case is that we have a content management system that needs the
> dependency information in another format than the pom.xml, and we would
> like to automate that. So the question is, can we use properties like this
> ${project.dependency(groupId=abc, artifactId=xzy).version}. I am sure that
> this XML Path like syntax does not work, but to give you an idea what I
> mean. Actually, it would be nice, if this syntax worked ;)
> 
> Mit freundlichen Grüßen / Best regards
> 
> 
> Andreas Ebbert-Karroum
> Teamleiter Softwareentwicklung
> 
> 
> 
> 
> codecentric GmbH, Merscheider Str. 1, 42699 Solingen
> 
> Büro: +49 (0) 212 233628-25, Mobil: +49 (0) 175 2664109, Fax: +49 (0) 212
> 233628-79
> 
> Internet:           www.codecentric.de<http://www.codecentric.de>
> Blog:                blog.codecentric.de<http://blog.codecentric.de>
> 
> Geschäftsführer: Mirko Novakovic und Rainer Vehns
> Sitz der Gesellschaft: Solingen
> Registergericht: Amtsgericht Wuppertal, HRB 19214
> 
> Diese E-Mail einschließlich evtl. angehängter Dateien enthält vertrauliche
> und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige
> Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie
> bitte sofort den Absender und löschen Sie diese E-Mail und evtl. anhängende
> Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen evtl.
> anhängender Dateien sowie die unbefugte Weitergabe dieser E-Mail ist nicht
> gestattet.


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