Re: Specifying the jar name in profiles

2007-08-29 Thread Tim Kettler

drippy schrieb:

This has all been helpful.  Now I am facing yet another challenge with this
setup.  


when I run mvn -PprofileA clean install my (service module) pom file does
not generate the pom that goes into the repository.  It only places the jar
file into it.


Yes, that's how it works. The artifacts with classifiers are meant to be 
installed/deployed alongsite the main artifact (the one without a 
classifier) of your project. The pom is copied when you install the main 
artifact.



This way when I am attempting to access the jar file from
another module (my webapp module) by the classifier it is sometimes failing
and sometimes working.  

>

It works if I manually move to the webapp module and run an install on the
webapp pom.  It will give me an error that says:

[WARNING] *** CHECKSUM FAILED - Error retrieving checksum file for
SNAPSHOT.pom - IGNORING

However when it does this, it will generate those files (the pom and other
xml files) for me in my .m2 repository.  When it does this, it works.  The
time it doesn't work is if I am doing an install from the parent of both of
these.  


I have in a parent pom multiple modules in which we do an install from:


../model
../persistence
../service
../webapp


if I call mvn -PprofileA clean install  from the parent pom containing this,
the webapp is not able to see the service jar file and doesn't attempt to
download it like it does when running the same command on the webapp pom
directly.  


I can't entirely follow you here. I tried to make a little testproject 
following the setup you describe above and everything is working as I 
would expect it.


I sent you a private mail with the testproject attached, as the list is 
blocking attachements. Can you try if you can reproduce the errors with 
the testproject and report back here on the list.



I have attempted to tell it to  but that doesn't seem to be
functioning.  


Any help?

Thanks again,
-Ben



-Tim



Tim Kettler wrote:
No, this is not possible (with the  tag). The repository is 
a structured storage for maven artifacts and the directory hierarchy and 
filename conventions are well defined. Every artifact in the repository 
has to adhere to this conventions else maven will not be able to 
retrieve the artifacts.


However, there is a simple solution (and I don't know why I didn't 
thought at it in the first place):


Maven has the concept of classifiers to discriminate between different 
flavours of the same artifact. This is used for things like providing 
artifacts for different JDK versions or installing the javadoc and 
source archives alongsite the main artifact. As classifiers are part of 
the identity of a dependency, they are preserved in the repository.


To cut a long story short, this pom should do what you want:

   
 4.0.0

 mygroup
 myartifact
 0.1-SNAPSHOT

 
   
 profileA
 
   
 
   org.apache.maven.plugins
   maven-jar-plugin
   
 profilea
   
 
   
 
   

   
 profileB
 
   
 
   org.apache.maven.plugins
   maven-jar-plugin
   
 profileb
   
 
   
 
   
 
   

-Tim

drippy schrieb:

Thanks Tim, that does work when packaging the jar.  Now I realize that I
also
need the name to stay when I am running install.  Is this an option? 


-Ben


Tim Kettler wrote:

Hi,

you can use  for this.

-Tim

drippy schrieb:

I have two profiles that I am using.  I'm trying to figure out if there
is a
way to make it so that when I package up a jar file I can specify the
name
of the jar file so that it is identifiable for that profile.

TIA,
Ben

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Specifying the jar name in profiles

2007-08-29 Thread drippy

This has all been helpful.  Now I am facing yet another challenge with this
setup.  

when I run mvn -PprofileA clean install my (service module) pom file does
not generate the pom that goes into the repository.  It only places the jar
file into it.  This way when I am attempting to access the jar file from
another module (my webapp module) by the classifier it is sometimes failing
and sometimes working.  

It works if I manually move to the webapp module and run an install on the
webapp pom.  It will give me an error that says:

[WARNING] *** CHECKSUM FAILED - Error retrieving checksum file for
SNAPSHOT.pom - IGNORING

However when it does this, it will generate those files (the pom and other
xml files) for me in my .m2 repository.  When it does this, it works.  The
time it doesn't work is if I am doing an install from the parent of both of
these.  

I have in a parent pom multiple modules in which we do an install from:


../model
../persistence
../service
../webapp


if I call mvn -PprofileA clean install  from the parent pom containing this,
the webapp is not able to see the service jar file and doesn't attempt to
download it like it does when running the same command on the webapp pom
directly.  

I have attempted to tell it to  but that doesn't seem to be
functioning.  

Any help?

Thanks again,
-Ben



Tim Kettler wrote:
> 
> No, this is not possible (with the  tag). The repository is 
> a structured storage for maven artifacts and the directory hierarchy and 
> filename conventions are well defined. Every artifact in the repository 
> has to adhere to this conventions else maven will not be able to 
> retrieve the artifacts.
> 
> However, there is a simple solution (and I don't know why I didn't 
> thought at it in the first place):
> 
> Maven has the concept of classifiers to discriminate between different 
> flavours of the same artifact. This is used for things like providing 
> artifacts for different JDK versions or installing the javadoc and 
> source archives alongsite the main artifact. As classifiers are part of 
> the identity of a dependency, they are preserved in the repository.
> 
> To cut a long story short, this pom should do what you want:
> 
>
>  4.0.0
> 
>  mygroup
>  myartifact
>  0.1-SNAPSHOT
> 
>  
>
>  profileA
>  
>
>  
>org.apache.maven.plugins
>maven-jar-plugin
>
>  profilea
>
>  
>
>  
>
> 
>
>  profileB
>  
>
>  
>org.apache.maven.plugins
>maven-jar-plugin
>
>  profileb
>
>  
>
>  
>
>  
>
> 
> -Tim
> 
> drippy schrieb:
>> Thanks Tim, that does work when packaging the jar.  Now I realize that I
>> also
>> need the name to stay when I am running install.  Is this an option? 
>> 
>> -Ben
>> 
>> 
>> Tim Kettler wrote:
>>> Hi,
>>>
>>> you can use  for this.
>>>
>>> -Tim
>>>
>>> drippy schrieb:
>>>> I have two profiles that I am using.  I'm trying to figure out if there
>>>> is a
>>>> way to make it so that when I package up a jar file I can specify the
>>>> name
>>>> of the jar file so that it is identifiable for that profile.
>>>>
>>>> TIA,
>>>> Ben
>>>
>>> -----------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Specifying-the-jar-name-in-profiles-tf4325808s177.html#a12390956
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Specifying the jar name in profiles

2007-08-26 Thread Tim Kettler
No, this is not possible (with the  tag). The repository is 
a structured storage for maven artifacts and the directory hierarchy and 
filename conventions are well defined. Every artifact in the repository 
has to adhere to this conventions else maven will not be able to 
retrieve the artifacts.


However, there is a simple solution (and I don't know why I didn't 
thought at it in the first place):


Maven has the concept of classifiers to discriminate between different 
flavours of the same artifact. This is used for things like providing 
artifacts for different JDK versions or installing the javadoc and 
source archives alongsite the main artifact. As classifiers are part of 
the identity of a dependency, they are preserved in the repository.


To cut a long story short, this pom should do what you want:

  
4.0.0

mygroup
myartifact
0.1-SNAPSHOT


  
profileA

  

  org.apache.maven.plugins
  maven-jar-plugin
  
profilea
  

  

  

  
profileB

  

  org.apache.maven.plugins
  maven-jar-plugin
  
profileb
  

  

  

  

-Tim

drippy schrieb:

Thanks Tim, that does work when packaging the jar.  Now I realize that I also
need the name to stay when I am running install.  Is this an option? 


-Ben


Tim Kettler wrote:

Hi,

you can use  for this.

-Tim

drippy schrieb:

I have two profiles that I am using.  I'm trying to figure out if there
is a
way to make it so that when I package up a jar file I can specify the
name
of the jar file so that it is identifiable for that profile.

TIA,
Ben


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Specifying the jar name in profiles

2007-08-26 Thread drippy

Thanks Tim, that does work when packaging the jar.  Now I realize that I also
need the name to stay when I am running install.  Is this an option? 

-Ben


Tim Kettler wrote:
> 
> Hi,
> 
> you can use  for this.
> 
> -Tim
> 
> drippy schrieb:
>> I have two profiles that I am using.  I'm trying to figure out if there
>> is a
>> way to make it so that when I package up a jar file I can specify the
>> name
>> of the jar file so that it is identifiable for that profile.
>> 
>> TIA,
>> Ben
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Specifying-the-jar-name-in-profiles-tf4325808s177.html#a12335958
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Specifying the jar name in profiles

2007-08-25 Thread Tim Kettler

Hi,

you can use  for this.

-Tim

drippy schrieb:

I have two profiles that I am using.  I'm trying to figure out if there is a
way to make it so that when I package up a jar file I can specify the name
of the jar file so that it is identifiable for that profile.

TIA,
Ben



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Specifying the jar name in profiles

2007-08-24 Thread drippy

I have two profiles that I am using.  I'm trying to figure out if there is a
way to make it so that when I package up a jar file I can specify the name
of the jar file so that it is identifiable for that profile.

TIA,
Ben
-- 
View this message in context: 
http://www.nabble.com/Specifying-the-jar-name-in-profiles-tf4325808s177.html#a12319940
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]