AW: How to add a dependency dynamically during the build in a plugin?

2009-01-15 Thread Lewis, Eric
Anyone?  :-) 

 -Ursprüngliche Nachricht-
 Von: Lewis, Eric [mailto:eric.le...@ipi.ch] 
 Gesendet: Dienstag, 13. Januar 2009 14:15
 An: Maven Users List
 Betreff: How to add a dependency dynamically during the build 
 in a plugin?
 
 Hi
 
 I just started to write my first plugin which should add some JARs
 dynamically to the project's dependencies.
 Unfortunately, I found no documentation about how to add a 
 dependency at
 runtime (Sonatype book, Maven site, blogs...).
 
 I have the project injected by Plexus and want to add some 
 dependencies
 like this:
   Dependency dependency = new Dependency();
   dependency.setGroupId(groupId);
   dependency.setArtifactId(artifactId);
   dependency.setVersion(version);
   dependency.setScope(system);
   dependency.setSystemPath(jarFile.getAbsolutePath());
   this.project.getDependencies().add(dependency);
 
 When using this.project.getDependencies() later on, I find those
 dependencies.
 
 However, I also added the Maven dependency plugin later in 
 the build to
 have a list of dependencies:
   plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-dependency-plugin/artifactId
 executions
   execution
 phasepackage/phase
 goals
   goallist/goal
 /goals
   /execution
 /executions
 configuration
   outputScopetrue/outputScope
  
 outputAbsoluteArtifactFilenametrue/outputAbsoluteArtifactFilename
 /configuration
   /plugin
 
 But it only shows the existing dependencies from the POM:
 [INFO] [dependency:list {execution: default}]
 [INFO] 
 [INFO] The following files have been resolved:
 [INFO]commons-lang:commons-lang:jar:2.4:compile:C:\Documents and
 Settings\xyz\.m2\repository\commons-lang\commons-lang\2.4\comm
 ons-lang-2
 .4.jar
 
 So obviously, it doesn't work.
 
 I also tried
 this.project.getDependencyManagement().addDependency(dependency);
 
 which didn't change anything.
 
 Is there a reference about the internals of the dependency mechanism?
 
 Best regards,
 Eric
 
 -
 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 install Maven plugins locally

2009-01-15 Thread Guofeng Zhang
It would be simpler if you could install a Maven Repository Management
in your Intranet, or copy the local repository from one machine to the
build machine, then run maven offline.

-Original Message-
From: Thummala, Sandhya [mailto:sandhya.thumm...@ca.com] 
Sent: Thursday, January 15, 2009 1:20 PM
To: users@maven.apache.org
Subject: How to install Maven plugins locally

Hi All,
I am using maven-surefire-report-plugin to generate unit test reports. 
Is there a way to install maven plugins locally? To explain further, if
my build machine doesn't have internet access, I download the maven
plugins that are required to run the reports manually, then install each
of these plugins on the build machine using install-file goal, then use
it to generate sure-fire reports.
I tried doing this, maven-surefire-report-plugin is installed in my
local repository using mvn install, but while executing the build, maven
is not able to find this plugin. I am getting following error:
 [exec] [ERROR] BUILD ERROR
 [exec] [INFO]

 [exec] [INFO] The plugin
'org.apache.maven.plugins:maven-surefire-report-plugin' does not exist
or no valid version could be found

Any pointers would be appreciated.
Thanks
Sandhya Thummala


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



Re: How to install Maven plugins locally

2009-01-15 Thread Gabriele Columbro
2009/1/15 Guofeng Zhang guof...@radvision.com

 It would be simpler if you could install a Maven Repository Management
 in your Intranet, or copy the local repository from one machine to the
 build machine, then run maven offline.


I agree with Zhang, this is the typical scenario for a Maven repository
manager which proxies your calls to the internet.
As an example, I'm having very good experiences with Nexus from Sonatype
[1].

Isn't this an option?

Hope this helps,
Gab


[1] http://nexus.sonatype.org/




 -Original Message-
 From: Thummala, Sandhya [mailto:sandhya.thumm...@ca.com]
 Sent: Thursday, January 15, 2009 1:20 PM
 To: users@maven.apache.org
 Subject: How to install Maven plugins locally

 Hi All,
 I am using maven-surefire-report-plugin to generate unit test reports.
 Is there a way to install maven plugins locally? To explain further, if
 my build machine doesn't have internet access, I download the maven
 plugins that are required to run the reports manually, then install each
 of these plugins on the build machine using install-file goal, then use
 it to generate sure-fire reports.
 I tried doing this, maven-surefire-report-plugin is installed in my
 local repository using mvn install, but while executing the build, maven
 is not able to find this plugin. I am getting following error:
 [exec] [ERROR] BUILD ERROR
 [exec] [INFO]
 
 [exec] [INFO] The plugin
 'org.apache.maven.plugins:maven-surefire-report-plugin' does not exist
 or no valid version could be found

 Any pointers would be appreciated.
 Thanks
 Sandhya Thummala


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




-- 
Gabriele Columbro
Alfresco ECM Product Strategy Consultant
+31 627 565 103
Sourcesense - Making sense of open Source (http://www.sourcesense.com)


Re: How to install Maven plugins locally

2009-01-15 Thread 苏林冲
zhang's suggestion is better^_^
yes ,copy the local repo from another machine also is good !

On Thu, Jan 15, 2009 at 4:53 PM, Gabriele Columbro 
g.colum...@sourcesense.com wrote:

 2009/1/15 Guofeng Zhang guof...@radvision.com

  It would be simpler if you could install a Maven Repository Management
  in your Intranet, or copy the local repository from one machine to the
  build machine, then run maven offline.
 

 I agree with Zhang, this is the typical scenario for a Maven repository
 manager which proxies your calls to the internet.
 As an example, I'm having very good experiences with Nexus from Sonatype
 [1].

 Isn't this an option?

 Hope this helps,
 Gab


 [1] http://nexus.sonatype.org/



 
  -Original Message-
  From: Thummala, Sandhya [mailto:sandhya.thumm...@ca.com]
  Sent: Thursday, January 15, 2009 1:20 PM
  To: users@maven.apache.org
  Subject: How to install Maven plugins locally
 
  Hi All,
  I am using maven-surefire-report-plugin to generate unit test reports.
  Is there a way to install maven plugins locally? To explain further, if
  my build machine doesn't have internet access, I download the maven
  plugins that are required to run the reports manually, then install each
  of these plugins on the build machine using install-file goal, then use
  it to generate sure-fire reports.
  I tried doing this, maven-surefire-report-plugin is installed in my
  local repository using mvn install, but while executing the build, maven
  is not able to find this plugin. I am getting following error:
  [exec] [ERROR] BUILD ERROR
  [exec] [INFO]
  
  [exec] [INFO] The plugin
  'org.apache.maven.plugins:maven-surefire-report-plugin' does not exist
  or no valid version could be found
 
  Any pointers would be appreciated.
  Thanks
  Sandhya Thummala
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
  For additional commands, e-mail: users-h...@maven.apache.org
 
 


 --
 Gabriele Columbro
 Alfresco ECM Product Strategy Consultant
 +31 627 565 103
 Sourcesense - Making sense of open Source (http://www.sourcesense.com)




-- 
漠洋(苏琳冲)
SuLinchong
Phone   13656669328
Qq387973308
Msn  sulinch...@hotmail.com


Re: Does the pluginGroup in the setting.xml work?

2009-01-15 Thread linchongsu
 does the pluginGroups in the setting.xml work? anybody comes to this
problem?

On Mon, Nov 24, 2008 at 3:21 PM, 苏林冲 sulinchong1...@gmail.com wrote:

 Anybody konw this?

 2008/11/21 苏林冲 sulinchong1...@gmail.com

 Hi, all
 I have set below in setting.xml
 pluginGroups
 pluginGroupcom.mycompany.maven.plugins/pluginGroup
  /pluginGroups

 when i run myplugin:exec , maven print these in the console

 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'myplugin'.
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] The plugin 'org.apache.maven.plugins:maven-myplugin-plugin' does
 not exist or no valid version could be found
 [INFO]
 
 [INFO] For more information, run Maven with the -e switch
 [INFO]
 
 [INFO] Total time:  1 second
 [INFO] Finished at: Fri Nov 21 13:05:34 CST 2008
 [INFO] Final Memory: 1M/2M
 [INFO]
 

 why does maven define the groupId org.apache.maven.plugins rather than
 com.mycompany.maven.plugins?

 And below is also the log infomation with -X


 + Error stacktraces are turned on.
 Maven version: 2.0.9
 Java version: 1.5.0_16
 OS name: windows xp version: 5.1 arch: x86 Family: windows
 [DEBUG] Building Maven user-level plugin registry from: 'C:\Documents and
 Settings\sulinchong.pt\.m2\plugin-registry.xml'
 [DEBUG] Building Maven global-level plugin registry from: 'D:\Program
 Files\apache-maven-2.0.9\conf\plugin-registry.xml'
 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'myplugin'.
 [DEBUG] Loading plugin prefixes from group: com.taobao.maven.plugins
 - does it work?
 [DEBUG] Loading plugin prefixes from group: org.apache.maven.plugins
 [DEBUG] Loading plugin prefixes from group: org.codehaus.mojo
 [DEBUG] maven-myplugin-plugin: using locally installed snapshot
 [DEBUG] Artifact not found - using stub model: Unable to determine the
 latest version

   org.apache.maven.plugins:maven-myplugin-plugin:pom:LATEST


 [DEBUG] Using defaults for missing POM
 org.apache.maven.plugins:maven-myplugin-plugin:pom:LATEST
 [DEBUG] maven-myplugin-plugin: using locally installed snapshot
 [DEBUG] Artifact not found - using stub model: Unable to determine the
 release version

   org.apache.maven.plugins:maven-myplugin-plugin:pom:RELEASE


 [DEBUG] Using defaults for missing POM
 org.apache.maven.plugins:maven-myplugin-plugin:pom:RELEASE
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] The plugin 'org.apache.maven.plugins:maven-myplugin-plugin' does
 not exist or no valid version could be found
 [INFO]
 
 [DEBUG] Trace
 org.apache.maven.lifecycle.LifecycleExecutionException: The plugin
 'org.apache.maven.plugins:maven-myplugin-plugin' does not exist or no valid
 version could be found
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1303)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1542)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:405)
 at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at
 org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
 at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
 Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException:
 The plugin 'org.apache.maven.plugins:maven-myplugin-plugin' does not exist
 or no valid version could be found
 at
 org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229)
 at
 org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91)
 at
 

How to exclude a package from compile

2009-01-15 Thread Peter Horlock
Hi,

I've got a java package (along with the jar dependencies it uses) that I do
not want to be added to the war file we send to our client. Also, I do not
want the pom.xml to be part of the war file.

(This is the default, the devevelopment war file is build by using a
profile).
I tried this:

build
resources
  resource

directory${basedir}/src/main/java/com/package1/package2/package3/**/directory
excludes
exclude*.*/exclude
  /excludes
  /resource
  resource
directory${basedir}/**/directory
excludes
excludepom.xml/exclude
  /excludes
/resource

However, this doesn't work! :-(

I also tried this:
  pluginManagement
 plugins
plugin
   artifactIdmaven-compiler-plugin/artifactId
   version2.0.2/version
   configuration
  source${javaVersion}/source
  target${javaVersion}/target
   excludes

exclude${basedir}/src/main/java/com/package1/package2/package3/**/exclude
   exclude**/pom.xml/exclude
   /excludes
   /configuration
/plugin

However, this neither worked! :-(

Last but not least - when I get this to work - I have a dependency that is
only used by the package I want to remove anyway -
so I can simply remove this dependency too, or how??


Thanks in advance!

Peter


Use of profiles

2009-01-15 Thread Eric Rotick
I can't recall where I read the advice but I've been using profiles to set
up various test scenarios. This works well as I can then use the dependency
logic. These are manually run tests via the command like as in

mvn -Ptest1

Within the profile I can then create a database, load it with test data, run
test cases against it and so on.

What I'm finding is the profiles which effectively implement the test cases
are in need of refactoring and something like the ability for one profile to
call another would be great. So, for example, a base profile would set up
the base database and other profiles would add specific test data to that.

So, the first question is, is this use of profiles correct? I can see that
primary purpose of profiles is to set up, well profiles, of different
scenarios for the build. In this respect the use of profiles for specific
tests falls loosely into this category. However, the use of profiles to
perform a kind of macro or script does not seem correct.

So, my second question is, what alternative is there to perform these types
of tests since the clever stuff that Maven does behind the scenes is a
requirement and there does not appear to be another way to achieve this
functionality?

Thanks.


Maven-bundle-plugin and Swing

2009-01-15 Thread inbroker

Hello Maveneers,
i am kinda freshman in maven and in java world as well so please excuse me
if the question is kinda easy to answer but i am really frustrated.

I am developing an OSGI bundle using Eclipse , m2eclipse ,
maven-bundle-plugin for the packaging and pax cursor for running the OSGI
environment.
So far I have made some client/server bundles that communicating fine just
writing messages on the console.
Now i try to show these messages in a simple GUI.
When i simply try to 
import javax.swing and just maven install i get the ERROR message 
package javax.swing does not exist

I added in the pom.xml file in the Import-Package section the
javax.swing.*.
I tried to find the mavenized project of swing but it didn't exist.

What am I doing wrong.
From internet search i have the impression that is totally ok for a bundle
to be the UI component.

Thanks in advance for your help.
-- 
View this message in context: 
http://www.nabble.com/Maven-bundle-plugin-and-Swing-tp21476430p21476430.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



denpendency/ for org/testng/testng/5.8/

2009-01-15 Thread thomas2004

Hi all,

I need the testng-5.8-jdk15.jar in my program and I find it under:
http://mirrors.ibiblio.org/pub/mirrors/maven2/org/testng/testng/5.8/

I put this dependency in the pom.xml as follow but it couldn't find that.
What is the correct writting for dependency/?

dependency
groupIdorg.testng/groupId
artifactIdtestng-5.8/artifactId
version5.8-jdk15/version
/dependency

-- 
View this message in context: 
http://www.nabble.com/%3Cdenpendency-%3E-for-org-testng-testng-5.8--tp21476664p21476664.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: denpendency/ for org/testng/testng/5.8/

2009-01-15 Thread inbroker


thomas2004 wrote:
 
 I need the testng-5.8-jdk15.jar in my program and I find it under:
 http://mirrors.ibiblio.org/pub/mirrors/maven2/org/testng/testng/5.8/
 

 I tried the following in Eclipse and worked fine
dependency
groupIdorg.testng/groupId
artifactIdtestng/artifactId
version5.8/version
typejar/type
classifierjdk15/classifier
scopecompile/scope
/dependency
although this was from the central repository.
http://repo1.maven.org/maven2.

I hope it helps.
Inbroker
-- 
View this message in context: 
http://www.nabble.com/%3Cdenpendency-%3E-for-org-testng-testng-5.8--tp21476664p21476760.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: denpendency/ for org/testng/testng/5.8/

2009-01-15 Thread thomas2004



inbroker wrote:
 
 
  I tried the following in Eclipse and worked fine
 dependency
   groupIdorg.testng/groupId
   artifactIdtestng/artifactId
   version5.8/version
   typejar/type
   classifierjdk15/classifier
   scopecompile/scope
 /dependency
 although this was from the central repository.
 http://repo1.maven.org/maven2.
 
 I hope it helps.
 Inbroker
 

Bingo, it works!

Thanks.
-- 
View this message in context: 
http://www.nabble.com/%3Cdenpendency-%3E-for-org-testng-testng-5.8--tp21476664p21476836.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: Does the pluginGroup in the setting.xml work?

2009-01-15 Thread Edelson, Justin

Yes, it works. The file is supposed to be called settings.xml.

On Jan 15, 2009, at 6:05 AM, linchongsu sulinchong1...@gmail.com  
wrote:



 does the pluginGroups in the setting.xml work? anybody comes to this
problem?

On Mon, Nov 24, 2008 at 3:21 PM, 苏林冲 sulinchong1...@gmail.com  
wrote:


 Anybody konw this?

 2008/11/21 苏林冲 sulinchong1...@gmail.com

 Hi, all
 I have set below in setting.xml
 pluginGroups
 pluginGroupcom.mycompany.maven.plugins/pluginGroup
  /pluginGroups

 when i run myplugin:exec , maven print these in the console

 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'myplugin'.
 [INFO]
  
--- 
-

 [ERROR] BUILD ERROR
 [INFO]
  
--- 
-
 [INFO] The plugin 'org.apache.maven.plugins:maven-myplugin- 
plugin' does

 not exist or no valid version could be found
 [INFO]
  
--- 
-

 [INFO] For more information, run Maven with the -e switch
 [INFO]
  
--- 
-

 [INFO] Total time:  1 second
 [INFO] Finished at: Fri Nov 21 13:05:34 CST 2008
 [INFO] Final Memory: 1M/2M
 [INFO]
  
--- 
-


 why does maven define the groupId org.apache.maven.plugins  
rather than

 com.mycompany.maven.plugins?

 And below is also the log infomation with -X


 + Error stacktraces are turned on.
 Maven version: 2.0.9
 Java version: 1.5.0_16
 OS name: windows xp version: 5.1 arch: x86 Family: windows
 [DEBUG] Building Maven user-level plugin registry from: 'C: 
\Documents and

 Settings\sulinchong.pt\.m2\plugin-registry.xml'
 [DEBUG] Building Maven global-level plugin registry from: 'D: 
\Program

 Files\apache-maven-2.0.9\conf\plugin-registry.xml'
 [INFO] Scanning for projects...
 [INFO] Searching repository for plugin with prefix: 'myplugin'.
 [DEBUG] Loading plugin prefixes from group:  
com.taobao.maven.plugins

 - does it work?
 [DEBUG] Loading plugin prefixes from group:  
org.apache.maven.plugins

 [DEBUG] Loading plugin prefixes from group: org.codehaus.mojo
 [DEBUG] maven-myplugin-plugin: using locally installed snapshot
 [DEBUG] Artifact not found - using stub model: Unable to  
determine the

 latest version

   org.apache.maven.plugins:maven-myplugin-plugin:pom:LATEST


 [DEBUG] Using defaults for missing POM
 org.apache.maven.plugins:maven-myplugin-plugin:pom:LATEST
 [DEBUG] maven-myplugin-plugin: using locally installed snapshot
 [DEBUG] Artifact not found - using stub model: Unable to  
determine the

 release version

   org.apache.maven.plugins:maven-myplugin-plugin:pom:RELEASE


 [DEBUG] Using defaults for missing POM
 org.apache.maven.plugins:maven-myplugin-plugin:pom:RELEASE
 [INFO]
  
--- 
-

 [ERROR] BUILD ERROR
 [INFO]
  
--- 
-
 [INFO] The plugin 'org.apache.maven.plugins:maven-myplugin- 
plugin' does

 not exist or no valid version could be found
 [INFO]
  
--- 
-

 [DEBUG] Trace
 org.apache.maven.lifecycle.LifecycleExecutionException: The plugin
 'org.apache.maven.plugins:maven-myplugin-plugin' does not exist  
or no valid

 version could be found
 at
  
org. 
apache. 
maven. 
lifecycle. 
DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java: 
1303)

 at
  
org. 
apache. 
maven. 
lifecycle. 
DefaultLifecycleExecutor. 
getMojoDescriptor(DefaultLifecycleExecutor.java:1542)

 at
  
org. 
apache. 
maven. 
lifecycle. 
DefaultLifecycleExecutor. 
segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:405)

 at
  
org. 
apache. 
maven. 
lifecycle. 
DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java: 
336)

 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
  
sun. 
reflect. 
NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

 at
  
sun. 
reflect. 
DelegatingMethodAccessorImpl. 
invoke(DelegatingMethodAccessorImpl.java:25)

 at java.lang.reflect.Method.invoke(Method.java:585)
 at  
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)

 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at
 org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java: 
430)

 at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
 Caused by:  
org.apache.maven.plugin.version.PluginVersionNotFoundException:
 The plugin 'org.apache.maven.plugins:maven-myplugin-plugin' does  
not exist

 or no 

Re: denpendency/ for org/testng/testng/5.8/

2009-01-15 Thread Martin Höller
Hi!

On Thursday 15 January 2009 thomas2004 wrote:
 I need the testng-5.8-jdk15.jar in my program and I find it under:
 http://mirrors.ibiblio.org/pub/mirrors/maven2/org/testng/testng/5.8/

 I put this dependency in the pom.xml as follow but it couldn't find
 that. What is the correct writting for dependency/?

You can always use http://www.mvnbrowser.com/ or http://mvnindex.org/ to 
find an artifact and see the corresponding pom-snippet.

hth,
- martin


signature.asc
Description: This is a digitally signed message part.


Using maven with eclipse

2009-01-15 Thread Farrukh Najmi


Hello,

I am experienced with maven but new to Eclipse IDE. I have used maven 
with Netbeans IDE and the mevenide Netbeans plugin. WHat I liked about 
it was how Netbeans was completely driven by the pom configuration and 
how natural and familiar everything was for a maven user.


I would like to try Eclipse IDE with my existing multi-module project. 
What is the best approack for doing this? Which plugin should I use? 
Please share any links and pointers. Thanks.


--
Regards,
Farrukh

Web: http://www.wellfleetsoftware.com



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



Re: Using maven with eclipse

2009-01-15 Thread Martin Höller
On Thursday 15 January 2009 Farrukh Najmi wrote:
 I am experienced with maven but new to Eclipse IDE. I have used maven
 with Netbeans IDE and the mevenide Netbeans plugin. WHat I liked about
 it was how Netbeans was completely driven by the pom configuration and
 how natural and familiar everything was for a maven user.

 I would like to try Eclipse IDE with my existing multi-module project.
 What is the best approack for doing this? Which plugin should I use?
 Please share any links and pointers. Thanks.

See [0] for a comparison of the available plugins.

The maven-eclipse-plugin just creates eclipse configuration files for your 
projects, no further intergration. This is simple, quite robust but doesn't 
provide as much comfort as the other two options.

I didn't use m2eclipse or q4e recently but they follow a completely 
different approach. They are plugins for eclipse and try to adapt your IDE 
and add new features to it.

If you search the list archive you should find some more information. This 
question is asked every now and then.

hth,
- martin

[0] http://docs.codehaus.org/display/MAVENUSER/Eclipse+Integration


signature.asc
Description: This is a digitally signed message part.


RE: Using maven with eclipse

2009-01-15 Thread Adam Leggett
Try this if you want an Eclipse plug-in to manage the integration:
http://m2eclipse.sonatype.org/ [1]

Try this if you want a Maven plug-in instead:
http://maven.apache.org/plugins/maven-eclipse-plugin/ [2]

I tend to lean to [2], but then I'm happier just using command line
mojos to get some of the additional value add that's in [1] (and it does
have some pretty slick features, which you'll see if you try it). For
example, I'd do something like  mvn dependency:tree  deps.log  etc.
Just feels like an instinctively lighter approach which I prefer.

Adam

-Original Message-
From: Farrukh Najmi [mailto:farr...@wellfleetsoftware.com] 
Sent: 15 January 2009 14:30
To: users@maven.apache.org
Subject: Using maven with eclipse


Hello,

I am experienced with maven but new to Eclipse IDE. I have used maven 
with Netbeans IDE and the mevenide Netbeans plugin. WHat I liked about 
it was how Netbeans was completely driven by the pom configuration and 
how natural and familiar everything was for a maven user.

I would like to try Eclipse IDE with my existing multi-module project. 
What is the best approack for doing this? Which plugin should I use? 
Please share any links and pointers. Thanks.

-- 
Regards,
Farrukh

Web: http://www.wellfleetsoftware.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



Re: AW: How to add a dependency dynamically during the build in a plugin?

2009-01-15 Thread Eugene Kuleshov

Eric,

  Short answer, please don't do it. Plugins that add dependencies like that
cause major grief to any ide integrations and also make it impossible to
change versions of used dependencies, essentially making your plugin less
useful.

  regards,
  Eugene



Lewis, Eric-2 wrote:
 
 Anyone?  :-) 
 
 -Ursprüngliche Nachricht-
 Von: Lewis, Eric [mailto:eric.le...@ipi.ch] 
 Gesendet: Dienstag, 13. Januar 2009 14:15
 An: Maven Users List
 Betreff: How to add a dependency dynamically during the build 
 in a plugin?
 
 Hi
 
 I just started to write my first plugin which should add some JARs
 dynamically to the project's dependencies.
 Unfortunately, I found no documentation about how to add a 
 dependency at
 runtime (Sonatype book, Maven site, blogs...).
 
 I have the project injected by Plexus and want to add some 
 dependencies
 like this:
   Dependency dependency = new Dependency();
   dependency.setGroupId(groupId);
   dependency.setArtifactId(artifactId);
   dependency.setVersion(version);
   dependency.setScope(system);
   dependency.setSystemPath(jarFile.getAbsolutePath());
   this.project.getDependencies().add(dependency);
 
 When using this.project.getDependencies() later on, I find those
 dependencies.
 
 However, I also added the Maven dependency plugin later in 
 the build to
 have a list of dependencies:
   plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-dependency-plugin/artifactId
 executions
   execution
 phasepackage/phase
 goals
   goallist/goal
 /goals
   /execution
 /executions
 configuration
   outputScopetrue/outputScope
  
 outputAbsoluteArtifactFilenametrue/outputAbsoluteArtifactFilename
 /configuration
   /plugin
 
 But it only shows the existing dependencies from the POM:
 [INFO] [dependency:list {execution: default}]
 [INFO] 
 [INFO] The following files have been resolved:
 [INFO]commons-lang:commons-lang:jar:2.4:compile:C:\Documents and
 Settings\xyz\.m2\repository\commons-lang\commons-lang\2.4\comm
 ons-lang-2
 .4.jar
 
 So obviously, it doesn't work.
 
 I also tried
 this.project.getDependencyManagement().addDependency(dependency);
 
 which didn't change anything.
 
 Is there a reference about the internals of the dependency mechanism?
 
 Best regards,
 Eric
 

-- 
View this message in context: 
http://www.nabble.com/How-to-add-a-dependency-dynamically-during-the-build-in-a-plugin--tp21435580p21480117.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: Using maven with eclipse

2009-01-15 Thread Eugene Kuleshov


Adam Leggett wrote:
 
 I tend to lean to [2], but then I'm happier just using command line
 mojos to get some of the additional value add that's in [1] (and it does
 have some pretty slick features, which you'll see if you try it). For
 example, I'd do something like  mvn dependency:tree  deps.log  etc.
 Just feels like an instinctively lighter approach which I prefer.
 

  The m2eclipse provides a nice an interactive UI for that command. You can
see how it look like at
http://docs.codehaus.org/display/M2ECLIPSE/Maven+POM+editor#MavenPOMeditor-DependencyHierarchyviewer

  The upcoming m2eclipse 0.9.7 release should be very exiting. The following
wiki page provides and overview of the new and noteworthy features
http://docs.codehaus.org/display/M2ECLIPSE/New+and+Noteworthy#NewandNoteworthy-latest

  regards,
  Eugene


-- 
View this message in context: 
http://www.nabble.com/Using-maven-with-eclipse-tp21478705p21480290.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: Using maven with eclipse

2009-01-15 Thread Carlos Sanchez
there's also Eclipse IAM (formerly Q4E) http://code.google.com/p/q4e/

re: dependency tree, I use all the time Q4E dependency analysis

http://code.google.com/p/q4e/wiki/DependencyAnalysis


On Thu, Jan 15, 2009 at 3:43 PM, Adam Leggett adam.legg...@upco.co.uk wrote:
 Try this if you want an Eclipse plug-in to manage the integration:
 http://m2eclipse.sonatype.org/ [1]

 Try this if you want a Maven plug-in instead:
 http://maven.apache.org/plugins/maven-eclipse-plugin/ [2]

 I tend to lean to [2], but then I'm happier just using command line
 mojos to get some of the additional value add that's in [1] (and it does
 have some pretty slick features, which you'll see if you try it). For
 example, I'd do something like  mvn dependency:tree  deps.log  etc.
 Just feels like an instinctively lighter approach which I prefer.

 Adam

 -Original Message-
 From: Farrukh Najmi [mailto:farr...@wellfleetsoftware.com]
 Sent: 15 January 2009 14:30
 To: users@maven.apache.org
 Subject: Using maven with eclipse


 Hello,

 I am experienced with maven but new to Eclipse IDE. I have used maven
 with Netbeans IDE and the mevenide Netbeans plugin. WHat I liked about
 it was how Netbeans was completely driven by the pom configuration and
 how natural and familiar everything was for a maven user.

 I would like to try Eclipse IDE with my existing multi-module project.
 What is the best approack for doing this? Which plugin should I use?
 Please share any links and pointers. Thanks.

 --
 Regards,
 Farrukh

 Web: http://www.wellfleetsoftware.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



APT into HTML without sidebar/header/footer

2009-01-15 Thread Trevor Harmon

Hi,

I have some documents authored in APT that get bundled with the  
project web site when doing mvn site. This transforms the APTs into  
separate HTML files, but each one has a copy of the site's sidebar,  
header, and footer. This is fine when viewing the document as part of  
the site, but if I want to, say, email one of the documents to an  
outside party, it will include this extraneous information that they  
don't want to see. So, I need to generate a version of the HTML  
without all the site-specific stuff. What's the best way to do this?  
Will I have to write a script to invoke doxia-converter or aptconvert  
explicitly? If so, how would I integrate that script into the Maven  
project? Thanks,


Trevor



Build problem using profiles

2009-01-15 Thread Wind Heart

Hi,

I have two profiles defined in pom.xml. Any ways I can build two wars of
both profiles in on line of command? i.e. mvn install -P
development,production and place them at different location?

Thanks in advance,
Vincent
-- 
View this message in context: 
http://www.nabble.com/Build-problem-using-profiles-tp21483041p21483041.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 add a dependency dynamically during the build in a plugin?

2009-01-15 Thread Wayne Fay
 I just started to write my first plugin which should add some JARs
 dynamically to the project's dependencies.

Adding dependencies dynamically during the build is generally regarded
as a bad idea for various reasons.

So, I don't expect that you will get much of a response to this...

Wayne

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



Re: How to exclude a package from compile

2009-01-15 Thread Wayne Fay
 I've got a java package (along with the jar dependencies it uses) that I do
 not want to be added to the war file we send to our client. Also, I do not
 want the pom.xml to be part of the war file.

I would move the code in that java package and its dependencies out of
the war to its own module, so you can manage its use more effectively.

Wayne

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



Re: Maven EAR Plugin ContextRoot

2009-01-15 Thread Stephen Duncan Jr
On Wed, Jan 14, 2009 at 5:39 PM, Stephen Duncan Jr stephen.dun...@gmail.com
 wrote:

 I'm following the instructions here to set the context-root for my web
 modules as specified here:
 http://maven.apache.org/plugins/maven-ear-plugin/examples/customizing-context-root.html

 It seems to have no effect on the generated application.xml, the
 context-root still has the default values.  I couldn't find any mention of
 this problem.  Can anyone else indicate if this works or not in the current
 release of the maven-ear-pluging (2.3.1)?

 --
 Stephen Duncan Jr
 www.stephenduncanjr.com


For now I've worked around the issue by using the applicationXml
configuration to point to my own application.xml with the context-root being
set, instead of using the generated one.  I'd still like to know if this is
just broken for everyone, or if there's something I'm missing so I can
decide how to file a bug.

-- 
Stephen Duncan Jr
www.stephenduncanjr.com


Re: Maven EAR Plugin ContextRoot

2009-01-15 Thread Wayne Fay
 For now I've worked around the issue by using the applicationXml
 configuration to point to my own application.xml with the context-root being
 set, instead of using the generated one.  I'd still like to know if this is
 just broken for everyone, or if there's something I'm missing so I can
 decide how to file a bug.

Take a look at the source code:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/WebModule.java?revision=728546view=markup

If I were you, I'd debug that class/method in an IDE or add some
System.out's to see what's going on during the execution of the code.
(This assumes you pull down the entire plugin and rebuild it with a
new version eg 2.3.99 which you'd build and install locally, and then
specify it in your pom.xml file -- make sure you delete it later!)
Without doing that, I'm not sure if there's a bug here or not.

Wayne

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



Uploading files created by assembly to server

2009-01-15 Thread News Assi
Hi,

I want to modify my release:perform goal, so it will automatically upload my 
assemblies to sourceforge, so I can easily provide them on the sourceforge 
download page.

Yet I can build the assemblies and upload the site on using release:perform 
by using this:
--- SNIP ---
plugin
  artifactIdmaven-release-plugin/artifactId
  configuration
tagBasehttps:/tagBase
allowTimestampedSnapshotstrue/allowTimestampedSnapshots
goalsassembly:assembly site-deploy/goals
  /configuration
/plugin
  /plugins
/build
--- SNAP ---

So I wonder, how I can perform uploading of four files.

There is Maven Wagon without any documentation:
http://maven.apache.org/wagon/index.html

And I found Maven Upload Plugin, that can upload a whole directory, but I want 
only four files saved in target directory:
http://docs.atlassian.com/maven-upload-plugin/1.1/usage.html

Perhaps someone can me help me on this.

Thanks a lot.

With regards


signature.asc
Description: This is a digitally signed message part.


dependency not found - fails to replace the version with the property for parent pom

2009-01-15 Thread lucist

Let`s say we have 2 branches Infrastructure and Web. 
The project web-core depends on infra-persist. 
We want to be able to manage the versions of the infra-persist and 
at the same time have a default value of 0.0.1-SNAPSHOT if no version 
is specified.  

Infrastructure 
   infra-parent
   infra-persist
and others 

Web
  web-parent
  web-core
and others 

In web-core I have 
artifactIdweb-core/artifactId
packagingjar/packaging
version${web.core.version}/version
parent
groupIdcom.abc.xyz/groupId
relativePath../web-parent/pom.xml/relativePath
artifactIdweb-parent/artifactId
version${web.parent.version}/version
/parent
dependencies
dependency
groupIdcom.abc.xyz/groupId
artifactIdinfra-persist/artifactId
version${infra.persist.version}/version
/dependency

  
In web-parent I have 
version${web.parent.version}/version
descriptionHolds common settings/description
properties
web.parent.version0.0.1-SNAPSHOT/web.parent.version
web.core.version${web.parent.version}/web.core.version
infra.parent.version0.0.1-SNAPSHOT/infra.parent.version
infra.persist.version0.0.1-SNAPSHOT/infra.persist.version   

/properties
modules
module../web-core/module
!-- and others --
/modules

In infra-persist I have  :
artifactIdinfra-persist/artifactId
version${infra.persist.version}version 
parent
groupIdcom.abc.xyz/groupId
relativePath../infra-parent/pom.xml/relativePath
artifactIdinfra-parent/artifactId
!-- Even though the parent version is specified as a property 
in the current pom maven doesn't take it into account --
version${infra.parent.version}/version
/parent

In infra-parent I have : 
artifactIdinfra-parent/artifactId
version${infra.parent.version}/version
packagingpom/packaging  
properties
infra.parent.version0.0.1-SNAPSHOT/infra.parent.version
infra.persist.version0.0.1-SNAPSHOT/infra.persist.version
/properties
modules
module../infra-persist/module
/modules


My build of infra started from infra-parent with mvn clean install works. 
My build of we started from web-parent with mvn clean install fails with  


[INFO]

[INFO] Building WEB interface 
[INFO]task-segment: [clean, install]
[INFO]

[INFO] [clean:clean]
[INFO] Deleting directory C:\4\Web\web-core\target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
Downloading:
http://com.abc.xyz:8080/maven-proxy-webapp/repository/com/abc/xyz/infra-parent/${infra.parent.version}/infra-parent-${infra.parent.version}.pom
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Failed to resolve artifact.


The only way I can make it work is if i hardcode in infra-persist 
artifactIdinfra-persist/artifactId
version${infra.persist.version}version 
parent
groupIdcom.abc.xyz/groupId
relativePath../infra-parent/pom.xml/relativePath
artifactIdinfra-parent/artifactId
!-- Even though the parent version is specified as a property 
in the current pom maven doesn't take it into account --
version0.0.1-SNAPSHOT/version
/parent

Thank you for all your hints and ideas, 
Lucian
-- 
View this message in context: 
http://www.nabble.com/dependency-not-found---fails-to-replace-the-version-with-the-property-for-parent-pom-tp21488666p21488666.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



Executing a plugin from another plugin

2009-01-15 Thread Trevor Harmon

Hi,

I have a custom plugin that I've written, and I need it to call out to  
some other plugin. For example, I've got the following code in a POM:


   plugin
   artifactIdmaven-assembly-plugin/artifactId
   executions
   execution
   idinstaller/id
   phasepackage/phase
   goals
   goaldirectory-single/goal
   /goals
   configuration
   descriptors
   descriptor
   src/assembly/production-assembly.xml
   /descriptor
   /descriptors
   /configuration
   /execution
   /executions
   /plugin

I want to take all that code out of the POM and have it execute inside  
my plugin instead. I assume this would require invoking the Mojo API.  
Any tips on how to do this? Thanks,


Trevor


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



exclude jars during filtering

2009-01-15 Thread Kamlesh Sangani
I have some jar files under src/test/resources folder. I have enabled
filter for the test resources. Now during filtering jar files get
corrupted. I have tried the following configuration but does not seem
to work.


pluginManagement
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-resources-plugin/artifactId
configuration
nonFilteredFileExtensions
nonFilteredFileExtensionjar/nonFilteredFileExtension
/nonFilteredFileExtensions
/configuration
/plugin
/plugins
/pluginManagement

Any help?



  

How to update property value of POM.xml in a maven plugin?

2009-01-15 Thread daition
Hi,
 
I have a question about developing maven plugin.
 
A plugin can get the property value of POM.xml, as @parameter annotation does.
But how can I create a new property in maven plugin, which can also be accessed 
in POM.xml? 
That is, how can I update the property value of POM.xml in a maven plugin?
I have searched for the documents, but no example found. Could anyone help to 
give an example?
 
Thanks!
Delos


Re: exclude jars during filtering

2009-01-15 Thread Wayne Fay
 I have some jar files under src/test/resources folder. I have enabled
 filter for the test resources. Now during filtering jar files get
 corrupted. I have tried the following configuration but does not seem

Many people use /src/main/resources/filtered and
/src/main/resources/unfiltered for this very reason (or /src/test).

You will, of course, have to configure the resources directories
manually in the pom as a result of this, as the default configuration
(convention) will no longer apply.

Wayne

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



Re: Maven-bundle-plugin and Swing

2009-01-15 Thread inbroker

Any suggestions please?
-- 
View this message in context: 
http://www.nabble.com/Maven-bundle-plugin-and-Swing-tp21476430p21494022.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