Question about snapshots?

2010-04-16 Thread James Russo
Hello, 

I have a project which has a dependency (jersey) on a -snapshot 
version. The publisher does *not* publish versioned snapshots, so I can't just 
override the dependency to use the version snapshot and then roll my own 
release. 

What are my options for turning this dependency into a versioned snapshot? I'm 
thinking about just downloading the source and changing the pom to deploy it to 
my own nexus repo where it will create a versioned snapshot.. Will requirement 
me to change repo path in pom and keep my own copy but this isn't a bad thing.

However, I was thinking if there was another way via proxy? Can I setup nexus 
to proxy to the other repo and grab a snapshot and create a versioned snapshot 
at that time? So I can use a versioned snapshot from my own repo, but it really 
would have originated from the java repo as an unversioned snapshot? The 
version information would be added at time of proxy? Is this possible?

thanks,

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



Re: Question about snapshots?

2010-04-16 Thread James Russo
Justin, 

Thanks for pointing me in the right direction. I will take your 
suggestions and go that route. 

thanks,

-jr

On Apr 16, 2010, at 10:03 AM, Justin Edelson wrote:

 There's a few ways to do this, but I would...
 1) check out the source at a known revision number.
 2) check it into your own SCM.
 3) modify the POM to have your own version number
 4) mvn -DaltDeploymentRepository=your own repo
 -DupdateReleaseInfo=true deploy
 
 The syntax for altDeploymentRepository is id::layout::url (layout is
 default 99.999% of the time). See
 http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html
 
 You could alternatively go through the full release process, but that's
 unnecessary IMHO unless you are patching the original source and would
 require making more changes to the original pom.
 
 BTW, you mean timestamped snapshots, not versioned snapshots. All
 artifacts are versioned.
 
 I don't think Nexus can do what you're describing, but that's probably a
 better question for the Nexus list.
 
 Justin
 
 
 On 4/16/10 9:38 AM, James Russo wrote:
 Hello, 
 
  I have a project which has a dependency (jersey) on a -snapshot 
 version. The publisher does *not* publish versioned snapshots, so I can't 
 just override the dependency to use the version snapshot and then roll my 
 own release. 
 
 What are my options for turning this dependency into a versioned snapshot? 
 I'm thinking about just downloading the source and changing the pom to 
 deploy it to my own nexus repo where it will create a versioned snapshot.. 
 Will requirement me to change repo path in pom and keep my own copy but this 
 isn't a bad thing.
 
 However, I was thinking if there was another way via proxy? Can I setup 
 nexus to proxy to the other repo and grab a snapshot and create a versioned 
 snapshot at that time? So I can use a versioned snapshot from my own repo, 
 but it really would have originated from the java repo as an unversioned 
 snapshot? The version information would be added at time of proxy? Is this 
 possible?
 
 thanks,
 
 -james
 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org
 


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



Re: obtain latest snapshot with single http call?

2009-12-07 Thread James Russo


On Dec 7, 2009, at 2:13 PM, Beat Strasser wrote:
 
 However, how do you handle authentication? For the above url to work,
 you need a valid session cookie. I'd would be ideal to have a single
 http call (using wget for example) with HTTP Basic Authentication (with
 SSL). Is there already a solution available for this?

I just use basic auth and seems to work fine.  Have you tried it?

-jr


Re: obtain latest snapshot with single http call?

2009-12-07 Thread James Russo
I use this call

wget --http-user=XXX --http-password=XXX 
http:///service/local/artifact/maven/redirect?r=snapshotsg=com.uappointa=MODULE-Av=3.0.1-SNAPSHOTp=exe;

but I am not running 4.0 yet. --http-user and --user should be equiv according 
to man page. 

I connect, get a 301 and then get 200 OK an download the artifact. 

-jr


On Dec 7, 2009, at 2:26 PM, Beat Strasser wrote:

 On Dec 7, 2009, at 2:13 PM, Beat Strasser wrote:
 However, how do you handle authentication? For the above url to work,
 you need a valid session cookie. I'd would be ideal to have a single
 http call (using wget for example) with HTTP Basic Authentication (with
 SSL). Is there already a solution available for this?
 I just use basic auth and seems to work fine.  Have you tried it?
 
 Yes. It only works in my browser when I first do a regular nexus web site 
 login. And I get a 401 if I try it with wget:
 
 wget https://host/service/local/...; --user asdf --password asdf
 
 I'm using Nexus OSS 1.4.0.
 
 -- 
 Beat Strasser
 
 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org
 


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



Re: properties in settings.xml

2009-11-14 Thread James Russo

Hello,

	Yes, it is. I've found that putting the real path in the pom.xml  
works fine, but I can't use a variable as the path.  The problem I  
have with putting it in the pom makes the pom very specific rather  
then the settings.xml.


I'm open for other suggestions on how to accomplish the same thing.  
Basically a profile which defines the build rules for NSIS installer  
should only be run when a path to NSIS is defined in the settings.xml  
file for the environment.


thanks,

-jr

On Nov 14, 2009, at 9:20 AM, Sony Antony wrote:


The file,exists block was inside activation right ?

profiles
profile
...
activation
fileexists${nsis.path}/exists/file
/activation

...
profile
profiles



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



Re: properties in settings.xml

2009-11-14 Thread James Russo

Hello,

	I'd rather not have to modify Maven for this. I'm also not looking  
for regular expressions, but rather just interpolation of the  
variables defined by other profiles. I guess the problem is the order  
in which the profiles are defined?


Is there a way to set a variable without using a activate by default  
profile in settings.xml?


-jr



On Nov 14, 2009, at 10:06 AM, Martin Gainty wrote:



i dont believe regularexpression parsing is currently available  
but you can modify org.apache.maven.profiles.Activation.java



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



Re: properties in settings.xml

2009-11-14 Thread James Russo


Activate the nsis profile in your settings.xml and use the same  
profile id

(without an activation element) in your POM.


Perfect. I'm going to go this route.

-jr



obtain latest snapshot to put on website for auto-update?

2009-11-13 Thread James Russo

Hello,

	I have some auto-update functionality built into an application, but  
I am looking to integrate it a bit with maven. I'd like to be able to  
export the latest snapshot to a location on our website where the  
updater can download it. I use nexus as my repo manager, but I have  
that locked down to require a login and I don't want to open this up.  
I want a simple public download URL.


Any suggestions on how I accomplish this? Can I just do a 'wget'  
against nexus to grab the latest snapshot and copy this to webserver?  
Is there a special latest snapshot link available in nexus or must I  
download the process the metadata to determine the latest one?


Perhaps I should just setup a simple no artifacts pom file which lists  
the artifact as a dependency and let that maven grab it for me?


Thanks!

-jr


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



Re: obtain latest snapshot to put on website for auto-update?

2009-11-13 Thread James Russo

Wayne,

	Thanks for your reply. I had thought the repo spec was fairly  
standardized by maven, so regardless of repo manager I might be able  
to accomplish this.  I will post it on the nexus user list though for  
more input.


I think maybe the simplest solution would be to write a script to  
authenticate against nexus (the HTTP based repo really), fetch the  
maven-metadata.xml file which appears to have info on the latest  
snapshot for a specific artifact and fetch it from there.


-jr


On Nov 13, 2009, at 11:12 AM, Wayne Fay wrote:

nexus to grab the latest snapshot and copy this to webserver? Is  
there a

...
special latest snapshot link available in nexus or must I  
download the


You do know about the Nexus User list, right? As a percentage of
users, maybe 15% of the Maven Users know anything about Nexus, vs
~100% of those on Nexus Users list.

Perhaps I should just setup a simple no artifacts pom file which  
lists the

artifact as a dependency and let that maven grab it for me?


Sounds like a reasonable solution. Otherwise this sounds like a good
feature request for Nexus.

Wayne

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




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



Re: obtain latest snapshot to put on website for auto-update?

2009-11-13 Thread James Russo

Peter,

exactly what I was looking for. Thanks!

-jr

On Nov 13, 2009, at 1:32 PM, Hayes, Peter wrote:


You can use this url:

http://host:port/nexus/service/local/artifact/maven/redirect? 
r=repositoryg=groupIda=artifactIdv=versionp=type


Nexus will handle the SNAPSHOT conversion to latest so you don't  
need to read the metadata or anything like that.


Peter

-Original Message-
From: James Russo [mailto:j...@halo3.net]
Sent: Friday, November 13, 2009 1:29 PM
To: Maven Users List
Subject: Re: obtain latest snapshot to put on website for auto-update?

Wayne,

Thanks for your reply. I had thought the repo spec was fairly
standardized by maven, so regardless of repo manager I might be able
to accomplish this.  I will post it on the nexus user list though for
more input.

I think maybe the simplest solution would be to write a script to
authenticate against nexus (the HTTP based repo really), fetch the
maven-metadata.xml file which appears to have info on the latest
snapshot for a specific artifact and fetch it from there.

-jr


On Nov 13, 2009, at 11:12 AM, Wayne Fay wrote:


nexus to grab the latest snapshot and copy this to webserver? Is
there a

...

special latest snapshot link available in nexus or must I
download the


You do know about the Nexus User list, right? As a percentage of
users, maybe 15% of the Maven Users know anything about Nexus, vs
~100% of those on Nexus Users list.


Perhaps I should just setup a simple no artifacts pom file which
lists the
artifact as a dependency and let that maven grab it for me?


Sounds like a reasonable solution. Otherwise this sounds like a good
feature request for Nexus.

Wayne

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




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


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




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



properties in settings.xml

2009-11-13 Thread James Russo

Hello,

	I have a project which uses nsis to create an installer, but NSIS  
isn't available on all of the platforms which I build the project, and  
I'd like it to skip making the NSIS when the makensis isn't available.  
I'd like to make the path to NSIS be configurable in the ~/.m2/ 
settings.xml, so I add it to a default profile which I created  
having a bunch of other properties:



 profiles
profile
  iddefault/id
  properties
database.driverClassNameorg.postgresql.Driver/ 
database.driverClassName

database.urljdbc:postgresql://localhost/test/database.url
database.useruser/database.user
database.passwordpassword/database.password
cargo.tomcat.manager.urlhttp://localhost:8081/manager/ 
cargo.tomcat.manager.url

cargo.remote.usernamemanager/cargo.remote.username
cargo.remote.passwordpassword/cargo.remote.password
customer.webapp.context//customer.webapp.context
client.webapp.context/client/client.webapp.context
nsis.path/usr/local/nsis/nsis-2.45/bin/makensis/nsis.path
!--
Introduced by Hudson, uncomment if not being used via  
hudson.

BUILD_NUMBERdev-build/BUILD_NUMBER
SVN_REVISIONunknown/SVN_REVISION
--
  /properties
/profile
  /profiles

So, I have a nsis.path defined in there.  However, I am trying to  
activate the profile in my pom and neither way works. I've tried to just
activate the profile in the pom based on presence of nsis.path  
variable and that doesn't work. And then I've also tried to do:


fileexists${nsis.path}/exists/file

and that doesn't work either.

How can I accomplish this? I could activate it manually with -P, but  
I'd rather just have everything in the settings.xml file since I need  
to visit that to setup the environment anyways.


thanks!

-jr


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



Re: [Fwd: Threads in a plug-in]

2009-10-29 Thread James Russo

Hello,

Actually it is the other way around. Daemon threads will not hold up JVM 
from exiting, but non-deamon threads will.


Marks this thread as either a daemon thread or a user thread. The Java 
Virtual Machine exits when the only threads running are all daemon threads.


The daemon flag will be set if the creating thread is a daemon thread. 
Maybe force the setDaemon to false on the newly created thread and that 
may give you desired effect.


-jr

Brian Fox wrote:

Maven just exits when it's done and then the jdk pulls everything
down. Isn't there a flag you can set on a thread to mark it as a
daemon thread, and then the system waits before killing it?

On Wed, Oct 28, 2009 at 9:20 AM, Gajo Csaba csaba.g...@cosylab.com wrote:
  

Good idea! I was actually hoping there was some switch I can set in Maven to
tell it not to terminate my thread, but I guess your idea would work fine as
well. Thanks!
Csaba


Stephen Connolly wrote:


add a second goal

the first goal will store some thread completion object in MavenSession or
in a Class level static field

When all threads are finished the completion object will be updated by the
last thread

The second goal blocks until the completion object is completed.

Then add the second goal execution to your project at the appropriate
phase
where you need the execution to have completed...

for example if you start the threads in the process-sources phase, you
might
be happy to let them run in the background until the test phase has
completed, but they must be finished by the time the package phase runs,
so
I would bind your execution of the second goal to the test phase

-Stephen

2009/10/28 Gajo Csaba csaba.g...@cosylab.com


  

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





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

  


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



maven projects which release installers?

2009-09-18 Thread James Russo

Hello,

   Does anyone know of a public project which uses maven and releases a 
windows installable artifact like a NSIS, exe, MSI, etc. Looking for 
some inspiration and prior art.


thanks,

-jr

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



Re: cargo:deploy fails to find artifact when run on parent project.

2009-09-16 Thread James Russo
Thanks! Will do.  I still really haven't wrapped my head around what all 
is possible with profiles, etc.


-jr

Anders Hammar wrote:

Yes. Was that a trick question? :-)
You just define that in the plugins element of the profile. I believe there
is something similar in the release profile that exists in the super pom.
Have a look at that or google.

/Anders

On Tue, Sep 15, 2009 at 22:40, James Russo j...@halo3.net wrote:

  

Thanks. I found and read it. In my situation I really am doing it to just
allow hudson to deploy it to the local development instance for others to
test against. So that we always have a snapshot up and running we can poke
at..

What I have done is just added the cargo:deploy to the webapp pom and then
just linked that goal to the deploy phase. so, now in hudson I go deploy and
when it gets
to that module (the webapp), it simply does the right thing and deploys it.

Is there any way to include/exclude a plugin by specifying a profile? ex:
can I have a hudson profile which attaches the cargo:deploy to the deploy
phase so when calling deploy without that profile activated it won't attempt
the cargo deploy?

-jr


Anders Hammar wrote:



There was a similar thread (however for glassfish) today. Have a look at
my
answer there about having a separate project for the deployment to
glassfish/tomcat.

/Anders

On Tue, Sep 15, 2009 at 21:18, James Russo j...@halo3.net wrote:



  

Hello,

 I'm likely just not going this the right way.. Have a project with 5
modules or so, one of which is a war. I'd like to be able to use
cargo:deploy on the parent project and have it work to deploy the war.
The
problem is that it stops at my first module saying artifact xyz isn't a
dependency of common.. Which is true.

The reason for this is I'd like to have hudson automatically deploy (via
maven) the latest war to tomcat.  Seems like tomcat:deploy automatically
skips modules where the artifact is not war, not sure how I could
achieve
the same thing using cargo.

-jr

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







  

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





  


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



Re: maven snapshots and archiva?

2009-09-15 Thread James Russo
Right, so on deploy it gets renamed. But when I try and do an operation 
which requires this dependency it is attempting to get
just -SNAPSHOT and getting 404 from the repo. I think it needs to be 
looking at some of the XML files in the repo to determine which 
date/timestamp to get but it isn't.


-jr

Stephen Connolly wrote:

somename-2.4.6-20090915.010112-1.jar is somename-2.4.6-SNAPSHOT.jar

-SNAPSHOT gets transformed on deployment to a remote repo into a timestamp

2009/9/15 James Russo j...@halo3.net:
  

Hello,

  Can someone help me figure out why maven is attempting to download
somename-2.4.6-SNAPSHOT.jar when only somename-2.4.6-20090915.010112-1.jar
exists in my local archiva repository. Running maven 2.2.1 and archiva
1.2.2.

thanks,

-jr

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





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

  


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



Re: NSIS with maven and exe artifacts.

2009-09-15 Thread James Russo

Perfect! Thanks!

-jr

Julien Graglia wrote:

Le lundi 14 septembre 2009 à 16:17 -0400, James Russo a écrit :
  

Hello Julien,

In your ncsetup.nsi, how do you reference the artifacts to be 
included with the .exe build?


My installer artifact is of type pom and depends of my war. Then I use
the assembly plugin to retrieve dependencies and output them in folders.
Ex : 
	dependencySets

!-- copy all deps in the libs subfolder. target only desps 
markes as
provided in my war --
dependencySet
outputDirectorylibs/outputDirectory
scopeprovided/scope
excludes
excludexxx:*/exclude
/excludes
/dependencySet
!-- copy all std deps in the libs subfolder. target only desps markes
as provided in my war --
dependencySet
outputDirectorylibs/outputDirectory
excludes
exclude:*/exclude
/excludes
/dependencySet
!--retreive all wars --
dependencySet
outputDirectorywebapps/outputDirectory

outputFileNameMapping${artifact.artifactId}.${artifact.extension}/outputFileNameMapping
scoperuntime/scope
includes
!--
http://maven.apache.org/plugins/maven-assembly-plugin/advanced-descriptor-topics.html
 --
include*:war:*/include
/includes
/dependencySet
...
Then I just have to tell NSIS to include thats folders and install them 


Extract of nsis.script in src/main/nsis/
SetOutPath $INSTDIR\libs
; copy all jars retrieved from the assembly plugin 
File /r ..\..\..\target\xxx-${VERSION}-base\libs\*

SetOutPath $INSTDIR\webapps
File /r ..\..\..\target\xxx-${VERSION}-base\webapps\*

et voilà!

  

thanks,

-jr

Julien Graglia wrote:


Le lundi 14 septembre 2009 à 10:03 -0400, James Russo a écrit :
  
  

Hello,
   
I have a module where I would like to take the artifacts producted 
by a few other modules and combine them into an .EXE using NSIS. I see 
that there is a nsis for maven 1.x, but I don't see anything for 2.x? 
Anyone done this before care to explain how they accomplished it?


Basically would like to have everything I need for NSIS in this module 
(other files, readme,  configuration, etc) and then have it grab 
dependencies from other modules include it in NSIS and generate EXE. 
Ultimately I'd like to deploy this .exe to archiva.





Hi,

Funny..., this morning, a guy on the maven irc just told me that a nsis
plugin (1) exists for maven 2. 
today I use :

assembly plugin to download dependencies
maven exec (2) to run NSIS with some properties during package phase
and build-helper-maven-plugin to attach generated .deb to my artifact
(so that I can donwload the install from archiva (5))
but all these plugins could be replaced by a single call to that nsis
plugin. (see extract from my pom in (4))

I will give it a try next week (well I will try to find some time...)


1 : http://mojo.codehaus.org/nsis-maven-plugin/
2 : http://mojo.codehaus.org/exec-maven-plugin/introduction.html
3 : http://mojo.codehaus.org/build-helper-maven-plugin/howto.html
4 : http://pastie.org/616361 ( but I told you, that nsis plugin could
replace the exec+buildhelper part with a single (may be 4:=) ) line(s))
5: BTW, If you use Archiva, don't forget to add .exe extension to the
list of artifacts scanned in the repositories)

  
  


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



Re: maven snapshots and archiva?

2009-09-15 Thread James Russo

Stephen,

   Never mind. I just did a deploy-file again and now it appears to be 
working. I must have done something wrong the first time. Thanks for the 
reply though.


-jr

Stephen Connolly wrote:

somename-2.4.6-20090915.010112-1.jar is somename-2.4.6-SNAPSHOT.jar

-SNAPSHOT gets transformed on deployment to a remote repo into a timestamp

2009/9/15 James Russo j...@halo3.net:
  

Hello,

  Can someone help me figure out why maven is attempting to download
somename-2.4.6-SNAPSHOT.jar when only somename-2.4.6-20090915.010112-1.jar
exists in my local archiva repository. Running maven 2.2.1 and archiva
1.2.2.

thanks,

-jr

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





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

  


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



cargo:deploy fails to find artifact when run on parent project.

2009-09-15 Thread James Russo

Hello,

   I'm likely just not going this the right way.. Have a project with 5 
modules or so, one of which is a war. I'd like to be able to use 
cargo:deploy on the parent project and have it work to deploy the war. 
The problem is that it stops at my first module saying artifact xyz 
isn't a dependency of common.. Which is true.


The reason for this is I'd like to have hudson automatically deploy (via 
maven) the latest war to tomcat.  Seems like tomcat:deploy automatically 
skips modules where the artifact is not war, not sure how I could 
achieve the same thing using cargo.


-jr

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



Re: cargo:deploy fails to find artifact when run on parent project.

2009-09-15 Thread James Russo
Thanks. I found and read it. In my situation I really am doing it to 
just allow hudson to deploy it to the local development instance for 
others to test against. So that we always have a snapshot up and running 
we can poke at..


What I have done is just added the cargo:deploy to the webapp pom and 
then just linked that goal to the deploy phase. so, now in hudson I go 
deploy and when it gets

to that module (the webapp), it simply does the right thing and deploys it.

Is there any way to include/exclude a plugin by specifying a profile? 
ex: can I have a hudson profile which attaches the cargo:deploy to the 
deploy phase so when calling deploy without that profile activated it 
won't attempt the cargo deploy?


-jr

Anders Hammar wrote:

There was a similar thread (however for glassfish) today. Have a look at my
answer there about having a separate project for the deployment to
glassfish/tomcat.

/Anders

On Tue, Sep 15, 2009 at 21:18, James Russo j...@halo3.net wrote:

  

Hello,

  I'm likely just not going this the right way.. Have a project with 5
modules or so, one of which is a war. I'd like to be able to use
cargo:deploy on the parent project and have it work to deploy the war. The
problem is that it stops at my first module saying artifact xyz isn't a
dependency of common.. Which is true.

The reason for this is I'd like to have hudson automatically deploy (via
maven) the latest war to tomcat.  Seems like tomcat:deploy automatically
skips modules where the artifact is not war, not sure how I could achieve
the same thing using cargo.

-jr

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





  


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



NSIS with maven and exe artifacts.

2009-09-14 Thread James Russo

Hello,
  
   I have a module where I would like to take the artifacts producted 
by a few other modules and combine them into an .EXE using NSIS. I see 
that there is a nsis for maven 1.x, but I don't see anything for 2.x? 
Anyone done this before care to explain how they accomplished it?


Basically would like to have everything I need for NSIS in this module 
(other files, readme,  configuration, etc) and then have it grab 
dependencies from other modules include it in NSIS and generate EXE. 
Ultimately I'd like to deploy this .exe to archiva.


thanks,

-jr

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



Re: NSIS with maven and exe artifacts.

2009-09-14 Thread James Russo

Will check those out. Thanks Stephen.

-jr

Stephen Connolly wrote:

try antrun to package and then build-helper to attach the generated
artifact to the reactor

2009/9/14 James Russo j...@halo3.net:
  

Hello,
I have a module where I would like to take the artifacts producted by a
few other modules and combine them into an .EXE using NSIS. I see that there
is a nsis for maven 1.x, but I don't see anything for 2.x? Anyone done this
before care to explain how they accomplished it?

Basically would like to have everything I need for NSIS in this module
(other files, readme,  configuration, etc) and then have it grab
dependencies from other modules include it in NSIS and generate EXE.
Ultimately I'd like to deploy this .exe to archiva.

thanks,

-jr

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





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

  


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



Re: NSIS with maven and exe artifacts.

2009-09-14 Thread James Russo

Hello,

   What I am not clear on is how one would reference artifacts required 
for this module which creates the installer. (it's dependencies?).  For 
example, my NSIS script will need a path to  a common.jar and a 
client.jar file which are artifacts of other maven modules. These other 
maven modules will be specified as dependencies in the pom.xml for my 
nsis module. I would think these should come from my local or repository.


thanks,

-jr

Stephen Connolly wrote:

try antrun to package and then build-helper to attach the generated
artifact to the reactor

2009/9/14 James Russo j...@halo3.net:
  

Hello,
I have a module where I would like to take the artifacts producted by a
few other modules and combine them into an .EXE using NSIS. I see that there
is a nsis for maven 1.x, but I don't see anything for 2.x? Anyone done this
before care to explain how they accomplished it?

Basically would like to have everything I need for NSIS in this module
(other files, readme,  configuration, etc) and then have it grab
dependencies from other modules include it in NSIS and generate EXE.
Ultimately I'd like to deploy this .exe to archiva.

thanks,

-jr

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





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

  


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



Re: NSIS with maven and exe artifacts.

2009-09-14 Thread James Russo

Hello Julien,

   Thanks for sharing all this. I will review this and try and give it 
a try as well.


jr

Hi,

Funny..., this morning, a guy on the maven irc just told me that a nsis
plugin (1) exists for maven 2. 
today I use :

assembly plugin to download dependencies
maven exec (2) to run NSIS with some properties during package phase
and build-helper-maven-plugin to attach generated .deb to my artifact
(so that I can donwload the install from archiva (5))
but all these plugins could be replaced by a single call to that nsis
plugin. (see extract from my pom in (4))

I will give it a try next week (well I will try to find some time...)


1 : http://mojo.codehaus.org/nsis-maven-plugin/
2 : http://mojo.codehaus.org/exec-maven-plugin/introduction.html
3 : http://mojo.codehaus.org/build-helper-maven-plugin/howto.html
4 : http://pastie.org/616361 ( but I told you, that nsis plugin could
replace the exec+buildhelper part with a single (may be 4:=) ) line(s))
5: BTW, If you use Archiva, don't forget to add .exe extension to the
list of artifacts scanned in the repositories)

  


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



Re: NSIS with maven and exe artifacts.

2009-09-14 Thread James Russo

Hello Julien,

   In your ncsetup.nsi, how do you reference the artifacts to be 
included with the .exe build?


thanks,

-jr

Julien Graglia wrote:

Le lundi 14 septembre 2009 à 10:03 -0400, James Russo a écrit :
  

Hello,
   
I have a module where I would like to take the artifacts producted 
by a few other modules and combine them into an .EXE using NSIS. I see 
that there is a nsis for maven 1.x, but I don't see anything for 2.x? 
Anyone done this before care to explain how they accomplished it?


Basically would like to have everything I need for NSIS in this module 
(other files, readme,  configuration, etc) and then have it grab 
dependencies from other modules include it in NSIS and generate EXE. 
Ultimately I'd like to deploy this .exe to archiva.





Hi,

Funny..., this morning, a guy on the maven irc just told me that a nsis
plugin (1) exists for maven 2. 
today I use :

assembly plugin to download dependencies
maven exec (2) to run NSIS with some properties during package phase
and build-helper-maven-plugin to attach generated .deb to my artifact
(so that I can donwload the install from archiva (5))
but all these plugins could be replaced by a single call to that nsis
plugin. (see extract from my pom in (4))

I will give it a try next week (well I will try to find some time...)


1 : http://mojo.codehaus.org/nsis-maven-plugin/
2 : http://mojo.codehaus.org/exec-maven-plugin/introduction.html
3 : http://mojo.codehaus.org/build-helper-maven-plugin/howto.html
4 : http://pastie.org/616361 ( but I told you, that nsis plugin could
replace the exec+buildhelper part with a single (may be 4:=) ) line(s))
5: BTW, If you use Archiva, don't forget to add .exe extension to the
list of artifacts scanned in the repositories)

  


maven snapshots and archiva?

2009-09-14 Thread James Russo

Hello,

   Can someone help me figure out why maven is attempting to download 
somename-2.4.6-SNAPSHOT.jar when only 
somename-2.4.6-20090915.010112-1.jar exists in my local archiva 
repository. Running maven 2.2.1 and archiva 1.2.2.


thanks,

-jr

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



question re: CI builds and maven.

2009-09-10 Thread James Russo

Hello,

   This is likely more of a software engineering related maven 
question. With the concept of snapshots and versioned artifacts where 
would a continuous build system come into place? How do others use it? I 
guess you really have two options, the CI system can produce snapshots 
or it can produce version'd releases.  I would imagine that you would 
want to have the CI server publish these artifacts back to your local 
internal repository..


So, how do others use continuous integration servers like hudson in 
their maven environment?


thanks!
-jr

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



Re: question re: CI builds and maven.

2009-09-10 Thread James Russo

Thanks, I guess it really could work either way.

I've normally used to having some type of automated build which 
eventually gets released as you move it forward (ie: v2.0.1.xyz, the xyz 
build of 2.0.1 is what ships), but what you are saying is just get 
things tested/integrated/refined by way of the snapshot artifacts from 
CI and then perform the release what that is all good.


I still need to read-up on the standard way of doing maven releases. 
Haven't gotten that far yet..


-jr


Todd Thiessen wrote:

CI I believe would use SNAPSHOTS. CI and SNAPSHOTs are a great match. It
would be somewhat more complicated to use releases. And you would deploy
to your maven repository so anyone else could then download to their
local.

---
Todd Thiessen
 

  

-Original Message-
From: James Russo [mailto:j...@halo3.net] 
Sent: Thursday, September 10, 2009 4:20 PM

To: Maven Users List
Subject: question re: CI builds and maven.

Hello,

This is likely more of a software engineering related 
maven question. With the concept of snapshots and versioned 
artifacts where would a continuous build system come into 
place? How do others use it? I guess you really have two 
options, the CI system can produce snapshots or it can 
produce version'd releases.  I would imagine that you would 
want to have the CI server publish these artifacts back to 
your local internal repository..


So, how do others use continuous integration servers like 
hudson in their maven environment?


thanks!
-jr

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





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

  


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



Re: question re: CI builds and maven.

2009-09-10 Thread James Russo

Thanks Wes,

   I understand. I guess for me, I'm really looking to automate the 
release portion of things. So, when I fix something or commit a change 
(to a version already released and deployed), I can just wait at the end 
of this big machine (build server) for a new release to be created with 
a new build number on it ready to go.


I would think you would want to post snapshots from the CI server to the 
repo so that all other developers would be constantly getting the 
snapshots of dependent artifacts without someone having to do a deploy. 
The CI server is doing the deploy each time there is a SCM change.


Any good place to read more about this stuff? Like how to organize svn 
in a way which permits you to fix bugs and create features at the same 
time..What version do you leave on the trunk, are you working on new 
versions/features in branches, etc. I'd be interested in hearing about 
what convention and assumptions maven uses in this regard with the 
release module.


thanks,

-jr

Wes Wannemacher wrote:

I use CI to make sure that unit tests all still pass in other
artifacts. For instance, I make changes in artifactA and somewhere
down a dependency chain, artifactB is affected... I may not realize
that my change breaks artifactB, I may not even know that artifactB
exists, but if the CI build shows test failures, someone knows where
to start looking (the changes the initiated the build?).

The CI does push to our nexus repo, but to me the fact that it can do
that is irrelevant.

-Wes

On Thu, Sep 10, 2009 at 4:20 PM, James Russo j...@halo3.net wrote:
  

Hello,

  This is likely more of a software engineering related maven question. With
the concept of snapshots and versioned artifacts where would a continuous
build system come into place? How do others use it? I guess you really have
two options, the CI system can produce snapshots or it can produce version'd
releases.  I would imagine that you would want to have the CI server publish
these artifacts back to your local internal repository..

So, how do others use continuous integration servers like hudson in their
maven environment?

thanks!
-jr

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







  


Re: profile activation based on env value?

2009-09-08 Thread James Russo



thanks for any help or suggestions on how I might make this work.
Obviously my goal is to simple keep database password out of svn and the
project.



Why do you set it in a profile at all? Your settings.xml is private to you.


Thanks. That is just the answer I was looking for actually. I will just 
keep a settings.xml file with these

values. This has a bonus of keeping them all in one place.

-jr

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



Re: Need a separate jar from war in assembly

2009-09-08 Thread James Russo


Jim Collings wrote:

I've created a xx-weblogic module. That part was easy. Problem is that
there is no lib dir. Maven doesn't copy libs to the source tree in
accordance with the idea that they should not be in the version
control system. So the question remains... how do I get the jar from
the repository and into the assembly?
  
The war plugin should be moving all the dependencies into the lib 
directory in WEB-INF/lib. Are you sure
you have specified the correct dependencies (ie: xx-weblogic?) in the 
xx-webapp module?


In my situation, I have xx-common, xx-server, xx-weblogic module all as 
jar maven modules. They all end up
in my WEB-INF/lib directory of my xx-webapp module along with any 
transitive dependencies like spring, commons-*, etc.


-jr

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



profile activation based on env value?

2009-09-07 Thread James Russo

Hello,

   In my ~/.m2/settings.xml I have:

settings
 profiles
   profile
 idsetup_database_password/id
 activation
   activeByDefaulttrue/activeByDefault
 /activation
 properties
   environment.typedev/environment.type
   database.passwordsecret/database.password
 /properties
   /profile
 /profiles
/settings


So, this should set environment.type to dev.

Then in one of my sub-projects pom (beneath parent, not sure that 
matters though) I have this:


   profiles
   profile
   idsetup_database_properties/id
   activation
 property
 nameenvironment.type/name
 valuedev/value
   /property

   /activation
   properties
   
database.driverClassNamecom.mysql.jdbc.Driver/database.driverClassName
   
database.urljdbc:postgresql://localhost/dbname/database.url

   database.userdbuser/database.user
   /properties
   /profile
   /profiles

However, when I run help:active-profiles I am only seeing the one 
profile (from ~/.m2/settings.xml) activated? I would expect that the 
profile in

my pom.xml file would be activated since the environment value is set.

If I specify -Denvironment.type=dev on the command line, it works as 
expected? If I change activation to !environment it works as well. Seems 
like it is just not

picking up properties added by ~/.m2/settings.xml.

thanks for any help or suggestions on how I might make this work. 
Obviously my goal is to simple keep database password out of svn and the 
project.


-jr

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



Re: profile activation based on env value?

2009-09-07 Thread James Russo

Thanks Dan..

I've looked at that, and it seems that I have it setup correctly. 
However, the profile in my pom (which should be activated by an property 
defined in my ~/.m2/settings.xml file) is never activated. Using 
help:effective-pom it shows that the property is there, so I know it is 
getting set.


It's almost like the setting of the property in the ~/.m2/settings 
profile takes place after evaluating the local pom.xml profile.


-jr

Dan Tran wrote:

you should be a to search for it

search
maven profile using environment variable

found
http://www.devx.com/Java/Article/32386/1763

good luck.

-D

On Mon, Sep 7, 2009 at 7:33 PM, James Russoj...@halo3.net wrote:
  

Hello,

  In my ~/.m2/settings.xml I have:

settings
 profiles
  profile
idsetup_database_password/id
activation
  activeByDefaulttrue/activeByDefault
/activation
properties
  environment.typedev/environment.type
  database.passwordsecret/database.password
/properties
  /profile
 /profiles
/settings


So, this should set environment.type to dev.

Then in one of my sub-projects pom (beneath parent, not sure that matters
though) I have this:

  profiles
  profile
  idsetup_database_properties/id
  activation
property
nameenvironment.type/name
valuedev/value
  /property

  /activation
  properties

database.driverClassNamecom.mysql.jdbc.Driver/database.driverClassName

database.urljdbc:postgresql://localhost/dbname/database.url
  database.userdbuser/database.user
  /properties
  /profile
  /profiles

However, when I run help:active-profiles I am only seeing the one profile
(from ~/.m2/settings.xml) activated? I would expect that the profile in
my pom.xml file would be activated since the environment value is set.

If I specify -Denvironment.type=dev on the command line, it works as
expected? If I change activation to !environment it works as well. Seems
like it is just not
picking up properties added by ~/.m2/settings.xml.

thanks for any help or suggestions on how I might make this work. Obviously
my goal is to simple keep database password out of svn and the project.

-jr

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





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

  


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



dependencies used for test and compile?

2009-09-03 Thread James Russo

Hello,

   I have a module A, B and C.  Module C requires both module A and B 
to compile and also test, do I need to include the dependency multiple 
times, once with scope test and once with scope compile?


-jr

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



Re: Getting Maven project resources (Eclipse)

2009-09-02 Thread James Russo

Hello,

   I just started with Maven also, but it appears that when you are 
running your test case the classpath will be set to both 
testproject/target/classes and testproject/target/testclasses.  Are 
these resources you need for a test or something and you won't know how 
many are there? ie: you need to run all of them?


Tell us more about what you are trying to accomplish.  I think I would 
maybe have a directory off test and put them in there and access them 
not as a resource but as a file. Then you can get
a directory listing and be done with it. Otherwise you need to specify 
the name of the resources to fetch somewhere..


thanks,

-jr


zagu2 wrote:

I'm using Eclipse and m2eclipse. Say I have a project like this:

testproject
- src
-- main
--- java
 MainClass.java
--- resources
 1.txt
 2.txt
-- test
--- java
 TestClass.java
--- resources
 3.txt

Now, I can have some code in TestClass doing something like:

this.getClass().getResource(/n.txt)

where n = 1, 2, 3 and it will fetch the appropriate file correctly - I can
get to each of the above text files, which is expected. 


However, I don't seem to find a way to fetch any text resource (i.e. *.txt),
tried the following:
- Use getResource and alikes - cannot do *.txt since the resource must be
fully named (asterisks don't work)
- Use getResource to find where compiled TestClass.class is stored and find
*.txt from that folder, since Maven separates these into target/classes and
target/test-classes, so I can only find 3.txt
- Get directly to source (i.e. src/main/resources and src/test/resources,
since I know their location), since I don't know how get to the project's
root (i.e. get path to the testproject)

I know I can do the absolute /a/b/.../z/workspace/testproject/..., but
that's very unportable. Another way would be to make a file with a known
name which would list all the resources, but that's lame (non-DRY), too. Did
you have problems like this and, if so, how did you solve them? 
  


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



Re: Getting Maven project resources (Eclipse)

2009-09-02 Thread James Russo


zagu2 wrote:

I suppose there are more examples of this. In general, it's - I want to load
many files and not have to specify what in two places - as files themselves
(which already contain a name) and as a list of resources (which just
duplicate the file names)
Understand..How about some type of generated class which gets list of 
files in resource directory and generates a class
with a strings[] of the required resource names. This generated class 
would be references from your test to load the right context.


Now, I'm new to maven so I wouldn't have a clue on how to wire that in.. 
I suppose in the code generation phase, maybe

using some type of ant task?

-jr

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



Re: dependency scope with parent module?

2009-08-31 Thread James Russo

Can anyone help me out this this?

-jr

James Russo wrote:

Hello,

   I have a parent module, and 3 sub? modules.

   project-common
   project-server
   project-weblogic

   I have parent setup in all of them, but for some reason when I 
can't get project-weblogic to compile if I scope set to test, and I 
can't get it to test if I set scope to compile? I had thought that 
setting it to test, would require it for both test and compile.


The only solution I could come up with is to put dependency in there 
twice, once with scope test and once with scope compile? Am I missing 
something?



-jr






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



dependency scope with parent module?

2009-08-29 Thread James Russo

Hello,

   I have a parent module, and 3 sub? modules.

   project-common
   project-server
   project-weblogic

   I have parent setup in all of them, but for some reason when I can't 
get project-weblogic to compile if I scope set to test, and I can't get 
it to test if I set scope to compile? I had thought that setting it to 
test, would require it for both test and compile.


The only solution I could come up with is to put dependency in there 
twice, once with scope test and once with scope compile? Am I missing 
something?



-jr





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



inject version into source?

2009-08-28 Thread James Russo

Hello,

   New maven user here. Really am liking it, just trying to get project 
back online and running after switching from ant.. Is there any standard 
maven way to inject maven variables (like version) into source code, 
prior to compile? Is this maybe were I should just leverage my existing 
any scripts to accomplish the task?


thanks,

-jr

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



Re: inject version into source?

2009-08-28 Thread James Russo

Dana,

   Thanks. That is fine. I am fine with just injecting the version 
value of the pom, but I need it accessible to my application. Current 
scheme for
this is to have it in a Version.java file as a static string which is 
referenced for display in the application.


Still trying to get my head around all this stuff. My application went 
from one big war file to now having a few jar files and one simple maven 
war
project which includes all the others. Going to be building them all at 
the same time, so they should all have the same version/build number. 
Thats on
my list too, how to get all sub modules to inherit version number from 
the parent pom. Thinking I just leave it out of the module poms, haven't 
tried that yet.


I was planning on looking at the maven-release plugin to generate real 
releases of my application... Don't use perforce though.



-jr


Lacoste, Dana (TSG Software San Diego) wrote:

So, basically, you use a wrapper to get around maven?

I do something similar: I use a .properties file, then run
an xmltask ant script to update the maven pom.xml files.
Very predictable, very manageable, and bypasses the
maven-release-plugin which caused ALL KINDS of headaches
because it doesn't work with perforce properly.

James, that'd be my recommendation: update the maven info
to fit your build before you run maven :)

Dana Lacoste

-Original Message-
From: David C. Hicks [mailto:dhi...@i-hicks.org] 
Sent: Friday, August 28, 2009 11:01 AM

To: Maven Users List
Subject: Re: inject version into source?

I have done this by setting up a properties file that gets filtered at
build time.  Then, I use that properties file in a Spring
PlaceholderConfigurer to get the value injected where I need it.

James Russo wrote:
  

Hello,

   New maven user here. Really am liking it, just trying to get
project back online and running after switching from ant.. Is there
any standard maven way to inject maven variables (like version) into
source code, prior to compile? Is this maybe were I should just
leverage my existing any scripts to accomplish the task?

thanks,

-jr

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




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


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

  


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



Re: inject version into source?

2009-08-28 Thread James Russo

Stephen,

   Thanks. I think I will take this route. Not sure what you mean about 
partial build though. If the .java file was updated each time, it 
would be compiled each time.


Right now, I can't seem to get the build-version maven module to fail if 
my local directory has modified code. docs say it should.


-jr

Stephen Connolly wrote:
another way is to store the version in the manifest and then retrieve 
the manifest from the classloader for the class you are loading... of 
course the downside is that if somebody makes an uberjar you'll have 
the version of the uberjar and nit the version of the code that was 
uberjarred (which is why the properties file is the recommended route.)


btw a static string constant in a file, eg Version.java will only get 
updated on a full clean build, so if you do a partial build, the 
version number would not get updated... yet another reason why 
properties files are preferred


Sent from my [rhymes with myPod] ;-)

On 28 Aug 2009, at 20:42, Stephen Connolly 
stephen.alan.conno...@gmail.com wrote:


turn on filtering for a specific resource (e.g. 
com/foo/bar/Version.properties)


have this file with the contents

version=${project.version}

replace your com.foo.bar.Version.java with code like so

public static String getVersion() {
 InputStream is = Version.class.getResource(Version.properties);
 Properties props = new Properties();
 props.loadFromStream(is);
 return props.getProperty(version);
}

obviously, add caching and error handling (no smart completion on the 
iPod)


-Stephen

Sent from my [rhymes with myPod] ;-)

On 28 Aug 2009, at 19:18, James Russo j...@halo3.net wrote:


Dana,

 Thanks. That is fine. I am fine with just injecting the version 
value of the pom, but I need it accessible to my application. 
Current scheme for
this is to have it in a Version.java file as a static string which 
is referenced for display in the application.


Still trying to get my head around all this stuff. My application 
went from one big war file to now having a few jar files and one 
simple maven war
project which includes all the others. Going to be building them all 
at the same time, so they should all have the same version/build 
number. Thats on
my list too, how to get all sub modules to inherit version number 
from the parent pom. Thinking I just leave it out of the module 
poms, haven't tried that yet.


I was planning on looking at the maven-release plugin to generate 
real releases of my application... Don't use perforce though.



-jr


Lacoste, Dana (TSG Software San Diego) wrote:

So, basically, you use a wrapper to get around maven?

I do something similar: I use a .properties file, then run
an xmltask ant script to update the maven pom.xml files.
Very predictable, very manageable, and bypasses the
maven-release-plugin which caused ALL KINDS of headaches
because it doesn't work with perforce properly.

James, that'd be my recommendation: update the maven info
to fit your build before you run maven :)

Dana Lacoste

-Original Message-
From: David C. Hicks [mailto:dhi...@i-hicks.org] Sent: Friday, 
August 28, 2009 11:01 AM

To: Maven Users List
Subject: Re: inject version into source?

I have done this by setting up a properties file that gets filtered at
build time.  Then, I use that properties file in a Spring
PlaceholderConfigurer to get the value injected where I need it.

James Russo wrote:


Hello,

 New maven user here. Really am liking it, just trying to get
project back online and running after switching from ant.. Is there
any standard maven way to inject maven variables (like version) into
source code, prior to compile? Is this maybe were I should just
leverage my existing any scripts to accomplish the task?

thanks,

-jr

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




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


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




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



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



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



Re: Need a separate jar from war in assembly

2009-08-28 Thread James Russo

Hello,

   So, the recommended way is to have something like this, correct?

   xx-weblogic (all code for web-application)
   xx-webapp (the actual war, containing src/main/webapp, 
src/main/resources, but no src/main. Code is really included though .jar 
files in lib).


-jr

Wendy Smoak wrote:

On Fri, Aug 28, 2009 at 1:06 PM, Jim Collingsjlistn...@gmail.com wrote:
  

So I have a jar that needs to be in an assembly but not in the war
file. It's a jdbc driver for the appserver.
How can I get it into the compressed archive but outside of the *.war file?



How is your project structured now?  Are you trying to build the
assembly out of the same module that builds the webapp?

If so, moving the assembly to a separate module may make things easier.

I'm guessing, so if that's not it, give us more details.

  


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



Re: inject version into source?

2009-08-28 Thread James Russo

Stephen,

   Thanks. I can honestly say I was not aware of that. I guess I hadn't 
been bitten by that one yet. Makes sense though..


-jr


Stephen Connolly wrote:
the spec for javac allows directly including public static final 
constants *by value* if they are one of the 8 primitives, or String.


so if another class (Foo.java) references Version.VERSION javac is 
allowed to *copy* the string at *compile* time. if you subsequently 
modify Version.java, but don't modify Foo.java then unless you delete 
Foo.class, the old version number will still be embedded in Foo.class


if you don't believe me, give it a try. IDE's such as eclipse and 
intellij guard against this early binding of public static final 
constants by keeping track of dependent classes and fixing a recompile 
if them. another route us to have a public static String noop(String 
v){return v;} in *another class* and define all your public static 
final constants through this function thereby forcing evaluation when 
the classes are loaded


Sent from my [rhymes with myPod] ;-)

On 28 Aug 2009, at 21:23, James Russo j...@halo3.net wrote:


Stephen,

  Thanks. I think I will take this route. Not sure what you mean 
about partial build though. If the .java file was updated each 
time, it would be compiled each time.


Right now, I can't seem to get the build-version maven module to fail 
if my local directory has modified code. docs say it should.


-jr

Stephen Connolly wrote:
another way is to store the version in the manifest and then 
retrieve the manifest from the classloader for the class you are 
loading... of course the downside is that if somebody makes an 
uberjar you'll have the version of the uberjar and nit the version 
of the code that was uberjarred (which is why the properties file is 
the recommended route.)


btw a static string constant in a file, eg Version.java will only 
get updated on a full clean build, so if you do a partial build, the 
version number would not get updated... yet another reason why 
properties files are preferred


Sent from my [rhymes with myPod] ;-)

On 28 Aug 2009, at 20:42, Stephen Connolly 
stephen.alan.conno...@gmail.com wrote:


turn on filtering for a specific resource (e.g. 
com/foo/bar/Version.properties)


have this file with the contents

version=${project.version}

replace your com.foo.bar.Version.java with code like so

public static String getVersion() {
InputStream is = Version.class.getResource(Version.properties);
Properties props = new Properties();
props.loadFromStream(is);
return props.getProperty(version);
}

obviously, add caching and error handling (no smart completion on 
the iPod)


-Stephen

Sent from my [rhymes with myPod] ;-)

On 28 Aug 2009, at 19:18, James Russo j...@halo3.net wrote:


Dana,

Thanks. That is fine. I am fine with just injecting the version 
value of the pom, but I need it accessible to my application. 
Current scheme for
this is to have it in a Version.java file as a static string which 
is referenced for display in the application.


Still trying to get my head around all this stuff. My application 
went from one big war file to now having a few jar files and one 
simple maven war
project which includes all the others. Going to be building them 
all at the same time, so they should all have the same 
version/build number. Thats on
my list too, how to get all sub modules to inherit version number 
from the parent pom. Thinking I just leave it out of the module 
poms, haven't tried that yet.


I was planning on looking at the maven-release plugin to generate 
real releases of my application... Don't use perforce though.



-jr


Lacoste, Dana (TSG Software San Diego) wrote:

So, basically, you use a wrapper to get around maven?

I do something similar: I use a .properties file, then run
an xmltask ant script to update the maven pom.xml files.
Very predictable, very manageable, and bypasses the
maven-release-plugin which caused ALL KINDS of headaches
because it doesn't work with perforce properly.

James, that'd be my recommendation: update the maven info
to fit your build before you run maven :)

Dana Lacoste

-Original Message-
From: David C. Hicks [mailto:dhi...@i-hicks.org] Sent: Friday, 
August 28, 2009 11:01 AM

To: Maven Users List
Subject: Re: inject version into source?

I have done this by setting up a properties file that gets 
filtered at

build time.  Then, I use that properties file in a Spring
PlaceholderConfigurer to get the value injected where I need it.

James Russo wrote:


Hello,

New maven user here. Really am liking it, just trying to get
project back online and running after switching from ant.. Is there
any standard maven way to inject maven variables (like version) 
into

source code, prior to compile? Is this maybe were I should just
leverage my existing any scripts to accomplish the task?

thanks,

-jr

- 


To unsubscribe, e-mail: users-unsubscr

plugin not reading finalName correctly?

2009-08-28 Thread James Russo

Hello,

   Trying to use buildnumber and tomcat:deploy. In my parent-pom, I've 
defined buildnumber. In my application-webapp (war), I define the tomcat 
deploy configuration. However,
when tomcat deploy tries to install it, for some reason the 
buildnumber variable comes across as null.


[INFO] Webapp assembled in[120 msecs]
[INFO] Building war: 
/Users/jamesrusso/Documents/workspace/project-maven/project-webapp/target/web-app-0.0.1-SNAPSHOT.3533.war

[INFO] [tomcat:deploy]
[INFO] 


[ERROR] BUILD ERROR
[INFO] 

[INFO] Cannot find war file: 
/Users/jamesrusso/Documents/workspace/project-maven/project-webapp/target/web-app-0.0.1-SNAPSHOT.null.war


I've tried pushing eveything down into the module pom, but same results? 
Any reason why the tomcat:deploy isn't picking up on the buildnumber 
variable?


thanks,

-jr

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