Re: Bndlib bug?

2012-09-21 Thread Stuart McCulloch
Bugs can be reported on the github site: https://github.com/bndtools/bnd or via 
the Apache Felix project. You should also try the latest 2.4.0-SNAPSHOT of the 
bundleplugin, as this uses the latest bndlib code which is expected to be 
released soon.

--
Cheers, Stuart

On 21 Sep 2012, at 01:04, Martin Gainty mgai...@hotmail.com wrote:

 Folks
 
 I came upon a fairly serious bug in in bndlib 1.50.0 ...
 i have a patch that works as a maven dependency for
  groupIdorg.apache.felix/groupId
  artifactIdmaven-bundle-plugin/artifactId
  version2.3.7/version
 
 i have tested this patch on 
 axis2-eclipse-service-plugin (eclipse plugin to generate axis2-1.6.2 service)
 
 Any ideas on where the JIRA is for bndlib and how to submit the patch would 
 be appreciated
 
 Thanks,
 Martin 
 __ 
 Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
 sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
 oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
 dem Austausch von Informationen und entfaltet keine rechtliche 
 Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
 wir keine Haftung fuer den Inhalt uebernehmen.
 Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
 destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
 l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
 est interdite. Ce message sert à l'information seulement et n'aura pas 
 n'importe quel effet légalement obligatoire. Étant donné que les email 
 peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
 aucune responsabilité pour le contenu fourni.
 

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



Re: Getting profile settings values in a Java class

2012-09-21 Thread Javix
Thanks a lot for your reply. I tried to use your way, but:

1. I already have a test folder under 'src' (scr/main and src/test which is
a standard Maven project structure).
2. I didn't really understand (sorry for that, - I'm not a Maven Guru :( )
the syntax to use in case of test prefix. I'd like to set up 4 different
environment with their corresponding properties.
3. I put a properties file 'app.properties' in scr/test/resources with the
following content:

host={test.host}

4. Tried to get properties in a java class as follows:

public Person() {
initProperies();
System.out.println(Got system properties:  +
properties.getProperty(host));
}

private void initProperies(){
properties = new Properties();
try {
properties.load(new FileInputStream(app.properties));
} catch (IOException ex) {
Logger.getLogger(Person.class.getName()).log(Level.SEVERE, null,
ex);
}
}

5. Got the FileNotFoundException when running 'mvn clean test' command.

Any idea how to:
- separate all the 4 profiles
- get the needed values in a Java class

Thanks in advance.







--
View this message in context: 
http://maven.40175.n5.nabble.com/Getting-profile-settings-values-in-a-Java-class-tp5722740p5722845.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



How to make release:prepare ask for password?

2012-09-21 Thread Magne Nordtveit
How can I make the release-plugin ask for a password when it needs it, rather 
than having to either a) provide it as a property when building, or b) putting 
it in a settings.xml file or equivalent. I don't like the fact that I have to 
have the password stored in a batch history file somewhere, or in a 
settings.xml file everybody knows where is...

Thanks,
--
Magne Nordtveit
Senior Systems Engineer

Mobile: +47 957 20 187

Offshore Simulator Centre AS
Visiting address: Borgundvegen 340, N-6009, Aalesund, Norway
Postal address:   Borgundvegen 340, N-6009, Aalesund, Norway
www.offsim.nohttp://www.offsim.no/



Re: Getting profile settings values in a Java class

2012-09-21 Thread Javix
Finally, I achived (I hope so, tell me if I'm wrong by pointing at some
pitfalls). Here is the updated version of the POM file:


project xmlns=http://maven.apache.org/POM/4.0.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd;
modelVersion4.0.0/modelVersion

groupIdcom.spot.sncf/groupId
artifactIdjava_cukes/artifactId
version1.0-SNAPSHOT/version
packagingjar/packaging

namejava_cukes/name
urlhttp://maven.apache.org/url
build
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-compiler-plugin/artifactId
version2.3.2/version
configuration
source1.6/source
target1.6/target
 
/configuration
/plugin

plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-site-plugin/artifactId
version3.1/version
configuration
reportPlugins
plugin
groupIdorg.apache.maven.plugins/groupId
   
artifactIdmaven-surefire-report-plugin/artifactId
version2.4.3/version
/plugin
/reportPlugins
/configuration
/plugin
/plugins

resources
resource
directorysrc/main/resources/directory
filteringtrue/filtering
/resource
/resources

/build
properties
project.build.sourceEncodingUTF-8/project.build.sourceEncoding
/properties

profiles
profile
idtoto/id   
activation
activeByDefaulttrue/activeByDefault
/activation
properties
hosthttp://toto.com/host
/properties  
/profile
profile
idyoyo/id   
properties
hosthttp://yoyo.com/host
/properties  
/profile
/profiles


dependencies
dependency
groupIdinfo.cukes/groupId
artifactIdcucumber-java/artifactId
version1.0.14/version
scopetest/scope
/dependency
dependency
groupIdinfo.cukes/groupId
artifactIdcucumber-junit/artifactId
version1.0.14/version
scopetest/scope
/dependency

dependency
groupIdjunit/groupId
artifactIdjunit/artifactId
version4.10/version
scopetest/scope
/dependency
/dependencies

/project

Call the host propoerty in Java:

public Person() {
initProperies();
System.out.println(Got system properties:  +
properties.getProperty(host));
}

private void initProperies(){
properties = new Properties();
try {
   
properties.load(getClass().getResourceAsStream(/app.properties));
} catch (IOException ex) {
Logger.getLogger(Person.class.getName()).log(Level.SEVERE, null,
ex);
}
}

I put the app.properties file in src/mai/resources with the following
content:

host=${host}

And it worked for me. Thank you all.
Regards




--
View this message in context: 
http://maven.40175.n5.nabble.com/Getting-profile-settings-values-in-a-Java-class-tp5722740p5722849.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



Re: How to make release:prepare ask for password?

2012-09-21 Thread Aliaksei Lahachou
Hi,

you can encrypt passwords in settings.xml:
http://maven.apache.org/guides/mini/guide-encryption.html.


Regards,
htfv (Aliaksei Lahachou)


On Fri, Sep 21, 2012 at 11:52 AM, Magne Nordtveit m...@offsim.no wrote:

 How can I make the release-plugin ask for a password when it needs it,
 rather than having to either a) provide it as a property when building, or
 b) putting it in a settings.xml file or equivalent. I don't like the fact
 that I have to have the password stored in a batch history file somewhere,
 or in a settings.xml file everybody knows where is...

 Thanks,
 --
 Magne Nordtveit
 Senior Systems Engineer

 Mobile: +47 957 20 187

 Offshore Simulator Centre AS
 Visiting address: Borgundvegen 340, N-6009, Aalesund, Norway
 Postal address:   Borgundvegen 340, N-6009, Aalesund, Norway
 www.offsim.nohttp://www.offsim.no/




Re: Getting profile settings values in a Java class

2012-09-21 Thread Zak Mc Kracken

Hi Roy,

that's a useful addition. Indeed I do something similar with with some 
command-line tools. I ship them as a zip which contains: a .jar a 
.sh/.bat invoking commands and a default .properties file. For the 
latter, I want different defaults depending on the environment where I 
deploy final zip. I could just ask the users to point to the right 
.properties file, but the fact is that we have the dev/test/production 
environments and in the first two we want a situation that is as close 
as possible to the third.


Thanks anyway.
Marco.

On 21/09/2012 01:32, Lyons, Roy wrote:

I would like to say that there is definitely a better way.  You *could*
continue to use maven for filtering your properties, but I wouldn't use it
as part of the build of the application.
  
If you are simply using scp or other similarly crude method of deployment

(meaning you are just deploying as a file transfer), I would say that you
could set up a maven project on the server side which handle the
deployment.  You can setup a pom.xml with all of the maven objects as
dependencies (including your jar/war/ear files you already built) and then
use the assembly plugin to create a staged application environment
including a variable replacement on template-ized external property files
which your application can reference (the replacement being done by
filtering within assembly directives).  As a matter of fact, I would argue
that this could be all stuffed in a git repository and your installation
could be done with:

ssh $servername git clone -b $branchname $gitprojecturl \; cd 
$targetdir
\; mvn -P $envname dependency:resolve assembly:assembly \; $startscript

Or

ssh $servername cd $targetdir \; $stopscript \; git clean -f \; git 
pull
origin \; mvn -P $envname dependency:resolve assembly:assembly \;
$startscript

Long and short is that it is still possible to do what you want with
maven, but not inside of the box you are thinking in.  As a configuration
engineer, I know that environment specific properties (and usually other
properties too) should always be stored in files external to your jar.
The Maven Way will tell you to make re-usable stuff.  Your deployment
artifacts are no exception.  Don't force a rebuild when a property has to
change.  Your QA folks will be extra thankful since the jar/war/ear will
maintain a constant md5sum that they can use to justify not performing
full regression tests.

Disclaimer:  We are using a highly sophisticated and expensive tool for
deployments and can't use this method due to auditing needs.  However we
still have our tool perform a post-process interpolation of variables
within config files based on environment to achieve a similar end result.

Also, to prevent a flame-war -- I am presenting this as a feasible
alternative way to use maven for the purpose of filtering properties based
on a profile being set (the original poster's intention) that will perhaps
help the original poster think outside of the box to achieve their goals.

Thanks,

Roy






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



Re: Getting profile settings values in a Java class

2012-09-21 Thread Zak Mc Kracken

Hi Javix,

yes, this is what I mean. You may want to consider what emerged in this 
thread about the goodness of this practice.


Cheers,
M.


On 21/09/2012 10:55, Javix wrote:

Finally, I achived (I hope so, tell me if I'm wrong by pointing at some
pitfalls). Here is the updated version of the POM file:





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



RE: How to make release:prepare ask for password?

2012-09-21 Thread Magne Nordtveit
That doesn't really answer my question though - that's just a replacement of a 
plain text password by an encrypted one. The value of that isn't really high 
when it requires the master password to be stored in a different file IMHO, but 
that's a different discussion all together. I want to be asked for password 
when one is required - that way NO passwords are stored longer than they have 
to.

Magne

-Original Message-
From: Aliaksei Lahachou [mailto:aliaksei.lahac...@gmail.com] 
Sent: Friday, 21 September, 2012 11:58
To: Maven Users List
Subject: Re: How to make release:prepare ask for password?

Hi,

you can encrypt passwords in settings.xml:
http://maven.apache.org/guides/mini/guide-encryption.html.


Regards,
htfv (Aliaksei Lahachou)


On Fri, Sep 21, 2012 at 11:52 AM, Magne Nordtveit m...@offsim.no wrote:

 How can I make the release-plugin ask for a password when it needs it, 
 rather than having to either a) provide it as a property when 
 building, or
 b) putting it in a settings.xml file or equivalent. I don't like the 
 fact that I have to have the password stored in a batch history file 
 somewhere, or in a settings.xml file everybody knows where is...

 Thanks,
 --
 Magne Nordtveit
 Senior Systems Engineer

 Mobile: +47 957 20 187

 Offshore Simulator Centre AS
 Visiting address: Borgundvegen 340, N-6009, Aalesund, Norway
 Postal address:   Borgundvegen 340, N-6009, Aalesund, Norway
 www.offsim.nohttp://www.offsim.no/



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



Re: How to make release:prepare ask for password?

2012-09-21 Thread Anders Hammar
Don't think you can have it ask for the password, but you can provide
it as a Java (system) property on command-line.
mvn release:prepare -Dpassword=blabla

/Anders

On Fri, Sep 21, 2012 at 11:52 AM, Magne Nordtveit m...@offsim.no wrote:
 How can I make the release-plugin ask for a password when it needs it, rather 
 than having to either a) provide it as a property when building, or b) 
 putting it in a settings.xml file or equivalent. I don't like the fact that I 
 have to have the password stored in a batch history file somewhere, or in a 
 settings.xml file everybody knows where is...

 Thanks,
 --
 Magne Nordtveit
 Senior Systems Engineer

 Mobile: +47 957 20 187

 Offshore Simulator Centre AS
 Visiting address: Borgundvegen 340, N-6009, Aalesund, Norway
 Postal address:   Borgundvegen 340, N-6009, Aalesund, Norway
 www.offsim.nohttp://www.offsim.no/


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



RE: How to make release:prepare ask for password?

2012-09-21 Thread Magne Nordtveit
That puts us back to having the password stored in some bash history file, in 
plain text... Looks like I might have to put in for a feature request. Just 
have to figure out where to put it :-P

Magne

-Original Message-
From: anders.g.ham...@gmail.com [mailto:anders.g.ham...@gmail.com] On Behalf Of 
Anders Hammar
Sent: Friday, 21 September, 2012 12:58
To: Maven Users List
Subject: Re: How to make release:prepare ask for password?

Don't think you can have it ask for the password, but you can provide it as a 
Java (system) property on command-line.
mvn release:prepare -Dpassword=blabla

/Anders

On Fri, Sep 21, 2012 at 11:52 AM, Magne Nordtveit m...@offsim.no wrote:
 How can I make the release-plugin ask for a password when it needs it, rather 
 than having to either a) provide it as a property when building, or b) 
 putting it in a settings.xml file or equivalent. I don't like the fact that I 
 have to have the password stored in a batch history file somewhere, or in a 
 settings.xml file everybody knows where is...

 Thanks,
 --
 Magne Nordtveit
 Senior Systems Engineer

 Mobile: +47 957 20 187

 Offshore Simulator Centre AS
 Visiting address: Borgundvegen 340, N-6009, Aalesund, Norway
 Postal address:   Borgundvegen 340, N-6009, Aalesund, Norway
 www.offsim.nohttp://www.offsim.no/


-
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: How to make release:prepare ask for password?

2012-09-21 Thread Anders Hammar
Feature requests are good. Patches are even better. :-)

/Anders

On Fri, Sep 21, 2012 at 1:29 PM, Magne Nordtveit m...@offsim.no wrote:
 That puts us back to having the password stored in some bash history file, in 
 plain text... Looks like I might have to put in for a feature request. Just 
 have to figure out where to put it :-P

 Magne

 -Original Message-
 From: anders.g.ham...@gmail.com [mailto:anders.g.ham...@gmail.com] On Behalf 
 Of Anders Hammar
 Sent: Friday, 21 September, 2012 12:58
 To: Maven Users List
 Subject: Re: How to make release:prepare ask for password?

 Don't think you can have it ask for the password, but you can provide it as a 
 Java (system) property on command-line.
 mvn release:prepare -Dpassword=blabla

 /Anders

 On Fri, Sep 21, 2012 at 11:52 AM, Magne Nordtveit m...@offsim.no wrote:
 How can I make the release-plugin ask for a password when it needs it, 
 rather than having to either a) provide it as a property when building, or 
 b) putting it in a settings.xml file or equivalent. I don't like the fact 
 that I have to have the password stored in a batch history file somewhere, 
 or in a settings.xml file everybody knows where is...

 Thanks,
 --
 Magne Nordtveit
 Senior Systems Engineer

 Mobile: +47 957 20 187

 Offshore Simulator Centre AS
 Visiting address: Borgundvegen 340, N-6009, Aalesund, Norway
 Postal address:   Borgundvegen 340, N-6009, Aalesund, Norway
 www.offsim.nohttp://www.offsim.no/


 -
 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



How to build war with dependencies in a different location

2012-09-21 Thread Bruce Albrecht
I have an application with OSGI bundles, and the Felix loader is looking 
for the jars to be in WEB-INF/bundles/3 instead of the usual 
WEB-INF/lib.  Is there a configuration for the war plugin, or a 
different plugin I can use to place these dependencies in a different 
location?


Thanks.

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



Re: How to build war with dependencies in a different location

2012-09-21 Thread Wayne Fay
 I have an application with OSGI bundles, and the Felix loader is looking for
 the jars to be in WEB-INF/bundles/3 instead of the usual WEB-INF/lib.  Is
 there a configuration for the war plugin, or a different plugin I can use to
 place these dependencies in a different location?

Assembly plugin will be your friend here. But surely there is a way to
configure Felix to look in WEB-INF/lib?

Wayne

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



Invoking Maven goals outside a project directory structure

2012-09-21 Thread Curtis Rueden
Hi everyone,

I was wondering whether there is a way to utilize certain useful Maven
goals when outside of a particular Maven project's actual source directory
structure. For example, I would like to ask Maven for the effective POM of
an installed artifact.

Why? Because I want to know the classpath fragment (all necessary JARs from
the local repository cache) for a given GAV.

I started writing a script to compute it manually. Current work in progress
is here:
https://gist.github.com/3762396

However, it would be nice to lean on the Maven command line tool to do the
heavy lifting, rather than doing recursive parsing like my script does now.
I definitely don't want to reinvent all the goodness that Maven provides.
Right now, there are many things the script can't deal with:
   1) downloading missing artifacts from a remote repository;
   2) computing an effective POM for the project;
   3) resolving properties properly from that effective POM...
Just to name a few at the tip of the iceberg.

It seems like many Maven goals (e.g., help:effective-pom, dependency:list,
dependency:tree) would make sense to invoke with respect to a given Maven
project, when outside of that project's actual source folder.

Is this at all possible? Or any alternative suggestion to achieve my goals
here?

Thanks,
Curtis


Re: How to make release:prepare ask for password?

2012-09-21 Thread Lyons, Roy
If this is related to your Nexus authentication, 2.1 is an awesome release
with regards to this.  They introduced an API token authentication
approach, so that you won't be handing over the keys to the castle if
someone compromises your API token password.

We are using it with encryption as well, and are storing the master
settings-security.xml in a secure location, pointing to it with a
relocation tag in the HOME/.m2/settings-security.xml file.

If you are already in linux, simply chmod go-rwx it.

Also, use SSL as a connection, so that the password cannot be sniffed.
Again, that might be overkill since it isn't a system account password.

If this is for your SCM, you may want to consider git instead of svn.  You
can use an ssh key with that, and will allow you to connect without
revealing a password.


Thanks,

Roy Lyons
Senior Configuration Engineer
(312) 648-3659 [w] 
(773) 551-8335 [c] 
roy.ly...@cmegroup.com
mailto:roy.ly...@cmegroup.com?subject=Contact%20from%20email%20signature
CME Group 
20 S. Wacker Drive
Chicago, Illinois 60606
Self Help 
https://wiki.chicago.cme.com/confluence/display/CM/Home
 






On 9/21/12 7:54 AM, Anders Hammar and...@hammar.net wrote:

Feature requests are good. Patches are even better. :-)

/Anders

On Fri, Sep 21, 2012 at 1:29 PM, Magne Nordtveit m...@offsim.no wrote:
 That puts us back to having the password stored in some bash history
file, in plain text... Looks like I might have to put in for a feature
request. Just have to figure out where to put it :-P

 Magne

 -Original Message-
 From: anders.g.ham...@gmail.com [mailto:anders.g.ham...@gmail.com] On
Behalf Of Anders Hammar
 Sent: Friday, 21 September, 2012 12:58
 To: Maven Users List
 Subject: Re: How to make release:prepare ask for password?

 Don't think you can have it ask for the password, but you can provide
it as a Java (system) property on command-line.
 mvn release:prepare -Dpassword=blabla

 /Anders

 On Fri, Sep 21, 2012 at 11:52 AM, Magne Nordtveit m...@offsim.no wrote:
 How can I make the release-plugin ask for a password when it needs it,
rather than having to either a) provide it as a property when building,
or b) putting it in a settings.xml file or equivalent. I don't like the
fact that I have to have the password stored in a batch history file
somewhere, or in a settings.xml file everybody knows where is...

 Thanks,
 --
 Magne Nordtveit
 Senior Systems Engineer

 Mobile: +47 957 20 187

 Offshore Simulator Centre AS
 Visiting address: Borgundvegen 340, N-6009, Aalesund, Norway
 Postal address:   Borgundvegen 340, N-6009, Aalesund, Norway
 www.offsim.nohttp://www.offsim.no/


 -
 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: Invoking Maven goals outside a project directory structure

2012-09-21 Thread Lyons, Roy
I have a possible interesting suggestion for you.  Scm plugin
bootstrapping.

http://maven.apache.org/scm/maven-scm-plugin/bootstrap-mojo.html


Given a pom with an scm section defined, you could bootstrap its entire
repo down and the perform the tasks you are trying to accomplish.

http://maven.apache.org/scm/maven-scm-plugin/examples/bootstrapping-with-po
m.html


Right now there isn't a great way to do the effective pom -- I know I have
tried to do so as well, and ended up just cloning down the repositories I
needed.





On 9/21/12 11:26 AM, Curtis Rueden ctrue...@wisc.edu wrote:

Hi everyone,

I was wondering whether there is a way to utilize certain useful Maven
goals when outside of a particular Maven project's actual source directory
structure. For example, I would like to ask Maven for the effective POM of
an installed artifact.

Why? Because I want to know the classpath fragment (all necessary JARs
from
the local repository cache) for a given GAV.

I started writing a script to compute it manually. Current work in
progress
is here:
https://gist.github.com/3762396

However, it would be nice to lean on the Maven command line tool to do the
heavy lifting, rather than doing recursive parsing like my script does
now.
I definitely don't want to reinvent all the goodness that Maven provides.
Right now, there are many things the script can't deal with:
   1) downloading missing artifacts from a remote repository;
   2) computing an effective POM for the project;
   3) resolving properties properly from that effective POM...
Just to name a few at the tip of the iceberg.

It seems like many Maven goals (e.g., help:effective-pom, dependency:list,
dependency:tree) would make sense to invoke with respect to a given Maven
project, when outside of that project's actual source folder.

Is this at all possible? Or any alternative suggestion to achieve my goals
here?

Thanks,
Curtis


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



Re: Invoking Maven goals outside a project directory structure

2012-09-21 Thread Curtis Rueden
Hi all,

Thanks Roy for the suggestion of SCM bootstrapping. That is definitely a
big hammer solution that would allow execution of any goal.

However, I found a workaround for the specific case of help:effective-pom.

If you want the effective POM for project foo:bar:1.0.0, you can run:

  mvn -f ~/.m2/repository/foo/bar/1.0.0/bar-1.0.0.pom help:effective-pom

Since that particular goal really only needs the POM, not the entire source
directory structure. Seems to work well for the projects I care about so
far, at least. And dependency:list and dependency:tree work too!

Regards,
Curtis


On Fri, Sep 21, 2012 at 11:36 AM, Lyons, Roy roy.ly...@cmegroup.com wrote:

 I have a possible interesting suggestion for you.  Scm plugin
 bootstrapping.

 http://maven.apache.org/scm/maven-scm-plugin/bootstrap-mojo.html


 Given a pom with an scm section defined, you could bootstrap its entire
 repo down and the perform the tasks you are trying to accomplish.

 http://maven.apache.org/scm/maven-scm-plugin/examples/bootstrapping-with-po
 m.html


 Right now there isn't a great way to do the effective pom -- I know I have
 tried to do so as well, and ended up just cloning down the repositories I
 needed.





 On 9/21/12 11:26 AM, Curtis Rueden ctrue...@wisc.edu wrote:

 Hi everyone,
 
 I was wondering whether there is a way to utilize certain useful Maven
 goals when outside of a particular Maven project's actual source directory
 structure. For example, I would like to ask Maven for the effective POM of
 an installed artifact.
 
 Why? Because I want to know the classpath fragment (all necessary JARs
 from
 the local repository cache) for a given GAV.
 
 I started writing a script to compute it manually. Current work in
 progress
 is here:
 https://gist.github.com/3762396
 
 However, it would be nice to lean on the Maven command line tool to do the
 heavy lifting, rather than doing recursive parsing like my script does
 now.
 I definitely don't want to reinvent all the goodness that Maven provides.
 Right now, there are many things the script can't deal with:
1) downloading missing artifacts from a remote repository;
2) computing an effective POM for the project;
3) resolving properties properly from that effective POM...
 Just to name a few at the tip of the iceberg.
 
 It seems like many Maven goals (e.g., help:effective-pom, dependency:list,
 dependency:tree) would make sense to invoke with respect to a given Maven
 project, when outside of that project's actual source folder.
 
 Is this at all possible? Or any alternative suggestion to achieve my goals
 here?
 
 Thanks,
 Curtis


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




RE: How to put a dependency in the classpath BEFORE jre.jar?

2012-09-21 Thread Markus KARG
Thank you for pointing me to this excellent blog entry, but in fact I wonder
why such a great tool like Maven doesn't have built-in support for endorsed
dependencies? I mean, in the end a different compiler might break the
solution, so it would be a good idea if a dependency could simply marked as
endorsedtrue/endorsed.

 -Original Message-
 From: Claves Do Amaral [mailto:claves.doama...@igmarkets.com]
 Sent: Donnerstag, 20. September 2012 10:30
 To: Maven Users List
 Subject: RE: How to put a dependency in the classpath BEFORE jre.jar?
 
 If I understand the problem well, this is equivalent to provide
 endorsed libraries at runtime.
 I have found this resource, that looks a bit dated, but it may work.
 Not sure if Maven 3 offers a better solution
 
 http://www.mindbug.org/2009/02/adding-endorsements-to-mavens-
 plugins.html
 
 Claves
 
 -Original Message-
 From: Markus Karg [mailto:k...@quipsy.de]
 Sent: 20 September 2012 09:22
 To: users@maven.apache.org
 Subject: How to put a dependency in the classpath BEFORE jre.jar?
 
 I have a dependency on javaee.jar, which provides newer versions for
 classes found in JRE's jre.jar (particularly the @Resource annotation).
 But javaee.jar is always appended to the classpath, while to be able to
 load the newer version, I need to PREFIX it before jre.jar instead. How
 can I configure this in the POM?
 
 
 The information contained in this email is strictly confidential and
 for the use of the addressee only, unless otherwise indicated. If you
 are not the intended recipient, please do not read, copy, use or
 disclose to others this message or any attachment. Please also notify
 the sender by replying to this email or by telephone (+44 (0)20 7896
 0011) and then delete the email and any copies of it. Opinions,
 conclusions (etc.) that do not relate to the official business of this
 company shall be understood as neither given nor endorsed by it. IG is
 a trading name of IG Markets Limited, a company registered in England
 and Wales under number 04008957. VAT registration number 761 2978 07.
 Registered Office: Cannon Bridge House, 25 Dowgate Hill, London EC4R
 2YA. Authorised and regulated by the Financial Services Authority. FSA
 Register number 195355.
 
 -
 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



Transitive Dep warning on root pom change

2012-09-21 Thread Peter Kahn
Hi all,

What's the maven way to allow to build individual modules and ensure that
changes to parent pom are uploaded into the local repository

Let's say I have three modules: one parent, two children (dbmod, appmod)
parent:dependencyManagement defines jdbc-foo 1.5
dbmod:   dependencies defines jdbc-foo getting version from parent
appmod: depens on dbmod

I build from parent getting parent-pom with jdbc-foo 1.5, dbmod using
jdbc-foo 1.5 and appmod.
I update source control and parent pom changes to jdbc-foo 1.6
I build in dbmod directory
I build in appmod directory
  appmod fetches dbmod from local repository and uses local repo version of
parent pom
  maven issues: [WARNING] The POM for ...dbmod:jar:3.5.0-SNAPSHOT is
invalid, transitive dependencies (if any) will not be available: 1 problem
was encountered while building the effective model for dbmod:3.5.0-SNAPSHOT
  compilation fails because my code relied on access to jdbc-foo 1.6 changes

I can resolve the problem these way:
If I install the parent pom file manually the problem, (mvn install-file
...)
If I build from the parent (if I have 80+ modules, this isn't ideal)
if I build from the parent selecting the desired project and using
also-make (mvn -am -pl :appmod  ...)

If there a config setting that would force parent install other than -am
pl :mod or is this the maven way to handle the situation?


Thanks

Peter




-- 
Peter Kahn
citizenk...@gmail.com
http://www.google.com/profiles/citizenkahn
Awareness - Intention - Action


Re: Invoking Maven goals outside a project directory structure

2012-09-21 Thread Anders Hammar
Possibly you could have a look at if your repo manager could help you
with this. I know that Nexus has this feature [1]; possibly other repo
managers do as well.

/Anders

[1] 
http://www.sonatype.com/books/nexus-book/reference/using-sect-browsing.html#fig-using-dependencies

On Fri, Sep 21, 2012 at 6:26 PM, Curtis Rueden ctrue...@wisc.edu wrote:
 Hi everyone,

 I was wondering whether there is a way to utilize certain useful Maven
 goals when outside of a particular Maven project's actual source directory
 structure. For example, I would like to ask Maven for the effective POM of
 an installed artifact.

 Why? Because I want to know the classpath fragment (all necessary JARs from
 the local repository cache) for a given GAV.

 I started writing a script to compute it manually. Current work in progress
 is here:
 https://gist.github.com/3762396

 However, it would be nice to lean on the Maven command line tool to do the
 heavy lifting, rather than doing recursive parsing like my script does now.
 I definitely don't want to reinvent all the goodness that Maven provides.
 Right now, there are many things the script can't deal with:
1) downloading missing artifacts from a remote repository;
2) computing an effective POM for the project;
3) resolving properties properly from that effective POM...
 Just to name a few at the tip of the iceberg.

 It seems like many Maven goals (e.g., help:effective-pom, dependency:list,
 dependency:tree) would make sense to invoke with respect to a given Maven
 project, when outside of that project's actual source folder.

 Is this at all possible? Or any alternative suggestion to achieve my goals
 here?

 Thanks,
 Curtis

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



Re: How to put a dependency in the classpath BEFORE jre.jar?

2012-09-21 Thread Stephen Connolly
1. Maven is not just about java (though very java focused I admit) endorsed
does not make sense outside of java
2. Whether a dependency needs to be endorsed or not depends on the jvm
version it targets... A dep can be fine until it gets added to the jvm spec.
3. It should probably more correctly be scopeendorsed/scope
4. Where would you package an endorsed dependency within a .war or .ear
file?

And don't get me started on the fact that to change this requires changing
the Pom format (which potentially could break ivy, gradle, leinengen, sbt,
etc)

Not an easy problem to solve, but I feel your pain

On Friday, 21 September 2012, Markus KARG wrote:

 Thank you for pointing me to this excellent blog entry, but in fact I
 wonder
 why such a great tool like Maven doesn't have built-in support for endorsed
 dependencies? I mean, in the end a different compiler might break the
 solution, so it would be a good idea if a dependency could simply marked as
 endorsedtrue/endorsed.

  -Original Message-
  From: Claves Do Amaral [mailto:claves.doama...@igmarkets.comjavascript:;
 ]
  Sent: Donnerstag, 20. September 2012 10:30
  To: Maven Users List
  Subject: RE: How to put a dependency in the classpath BEFORE jre.jar?
 
  If I understand the problem well, this is equivalent to provide
  endorsed libraries at runtime.
  I have found this resource, that looks a bit dated, but it may work.
  Not sure if Maven 3 offers a better solution
 
  http://www.mindbug.org/2009/02/adding-endorsements-to-mavens-
  plugins.html
 
  Claves
 
  -Original Message-
  From: Markus Karg [mailto:k...@quipsy.de javascript:;]
  Sent: 20 September 2012 09:22
  To: users@maven.apache.org javascript:;
  Subject: How to put a dependency in the classpath BEFORE jre.jar?
 
  I have a dependency on javaee.jar, which provides newer versions for
  classes found in JRE's jre.jar (particularly the @Resource annotation).
  But javaee.jar is always appended to the classpath, while to be able to
  load the newer version, I need to PREFIX it before jre.jar instead. How
  can I configure this in the POM?
 
 
  The information contained in this email is strictly confidential and
  for the use of the addressee only, unless otherwise indicated. If you
  are not the intended recipient, please do not read, copy, use or
  disclose to others this message or any attachment. Please also notify
  the sender by replying to this email or by telephone (+44 (0)20 7896
  0011) and then delete the email and any copies of it. Opinions,
  conclusions (etc.) that do not relate to the official business of this
  company shall be understood as neither given nor endorsed by it. IG is
  a trading name of IG Markets Limited, a company registered in England
  and Wales under number 04008957. VAT registration number 761 2978 07.
  Registered Office: Cannon Bridge House, 25 Dowgate Hill, London EC4R
  2YA. Authorised and regulated by the Financial Services Authority. FSA
  Register number 195355.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@maven.apache.orgjavascript:;
  For additional commands, e-mail: users-h...@maven.apache.orgjavascript:;



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