RE: User-defined phase
That's a great idea! However, how do I tell the exec-plugin where to find maven itself? When I try: --- mvn exec:exec -Dexec.executable=maven -Dexec.args=clean --- I get the following error message: [INFO] [INFO] [exec:exec] [INFO] 'd:\SourceCode\web-app-template\refdb\web\mvn' is not recognized as an internal or external command, [INFO] operable program or batch file. [INFO] It seems as if he tries to call the executable from the current directory, which is, of course, not possible. I also don't want to provide an absolute path. I want that the program searches the program within the defined path of the environments 'path' varariable. -Original Message- From: Eric Redmond [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 7. Dezember 2006 16:07 To: Maven Users List Subject: Re: User-defined phase The phases are community defined, and there are no plans to ever change that. This is why Maven is easy to understand and use wherever you go - rather than having to learn a bunch of custom stuff. If you really want to coallate your work into a single command, try using the exec goal: http://mojo.codehaus.org/exec-maven-plugin/ Eric On 12/7/06, Deluigi Marcus [EMAIL PROTECTED] wrote: Hi I want to abuse maven to perform a setup for a testing environment, such as starting derby, starting a tomcat and deploying a WAR file which is another project. Maven does a fine job in downloading all the required software if necessary and building the WAR file which it is another project. Besides, it is platform independent, so I am using it for all these tasks. But I don't want to enter all these commands on the command line all the time. I think a much nicer way would be to add a custom phase (such as 'start-environment') to the module. When I am developing, I would like to be able to execute only this phase, without the life-cycle. Is something like that possible? Of course, I can make a shell-script but I think adding a custom phase to the project would be a nice thing. Greetings Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Eric Redmond http://codehaus.org/~eredmond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
User-defined phase
Hi I want to abuse maven to perform a setup for a testing environment, such as starting derby, starting a tomcat and deploying a WAR file which is another project. Maven does a fine job in downloading all the required software if necessary and building the WAR file which it is another project. Besides, it is platform independent, so I am using it for all these tasks. But I don't want to enter all these commands on the command line all the time. I think a much nicer way would be to add a custom phase (such as 'start-environment') to the module. When I am developing, I would like to be able to execute only this phase, without the life-cycle. Is something like that possible? Of course, I can make a shell-script but I think adding a custom phase to the project would be a nice thing. Greetings Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Creating Archetypes
Hi Is it possible to create an archetype with sub-projects? You can imagine that I want to create nested archetypes: the end-user should obtain a project that contains sub-projects. Thanks for any help! Greetings Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Parent Directory
Hello. Is there a Maven property that points to the projects root directory? It may be not elegant to let the sub-modules know about the directory of their parent module, but I have several centralized configuration files (e.g. for log4j and tomcat) stored in the root-modules directory and I want that all subprojects access them. I tried ${basedir} but apparently it just points to the current working directory, so it changes for every submodule. Thanks for any hints! Greetings, Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Classpath
I tried that within my java project: System.out.println(System.property(..)) Unfortunately, it's not working. All I see is a global classpath which points to a Maven jar. Maven is using a customized classloader, so it's hard to get the module-specific classpath. When using the '-X' switch, the only difference that I can see is that a dependent project gets the status 'active' when executing the test from a parent project. This prevents the test from finding some resources from the parents. How does it affect the classpath if a module is active? Marcus -Original Message- From: Eric Redmond [mailto:[EMAIL PROTECTED] Sent: Montag, 20. November 2006 16:12 To: Maven Users List Subject: Re: Classpath Try something like this in your POM (or external profiles.xml file... which would probably be better) build plugins plugin artifactIdmaven-antrun-plugin/artifactId executions execution goalsgoalrun/goal/goals phasecompilephase /execution execution goalsgoalrun/goal/goals phasetestphase /execution /executions configuration tasksechojava.class.path=${java.class.path} /echoechoCLASSPATH=${env.CLASSPATH}/echo/tasks /configuration ... Eric On 11/20/06, Deluigi Marcus [EMAIL PROTECTED] wrote: We ported an existing project from ant to maven and it seems as if the classpath of one module is different to the classpath to the parent modules which causes the junit tests to fail in the parent modules. Since the junit tests fail, it is not possible to proceed to the install phase. I was hoping to be able to print the java class path for the compile phase and the test phase separately. Greetings, Marcus -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Montag, 20. November 2006 15:03 To: Maven Users List Subject: Re: Classpath On 11/20/06, Deluigi Marcus [EMAIL PROTECTED] wrote: It seems like a stupid question, but how do I let maven print the actual class path within a specific module? I did not find any information about this anywhere. If you add -X to the command line: mvn install -X it will print out more than you ever wanted to know, including a tree view of the dependencies, and, underneath, [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-compiler-plugin:2.0.1:compile' -- one of the items is classpathElements. HTH, -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Eric Redmond http://codehaus.org/~eredmond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Print customized messages on failure
Hi. Is there any method to let Maven print a customized message if a phase fails? I want to give a list with the most common configuration mistakes which lead to JUnit test failures. Greetings, Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Classpath
Hi It seems like a stupid question, but how do I let maven print the actual class path within a specific module? I did not find any information about this anywhere. Thanks! Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help on profiles
Hi I have the following scenario: I have a project with several modules. One of the modules starts a container with Cargo in the pre-integration-phase, tests something in the integration phase and stops Tomcat in the post-integration-phase. There is a profile called 'tomcat' which is activated by default that sets the container to Tomcat for Cargo. In order to make sure that Tomcat is started with the right configuration, I always want to copy my custom configuration file into the Tomcats configuration directory. This is done by ant ant-task which should only be executed, if the actual profile is really Tomcat. It is also important that the configuration file is copied _before_ the container is started. So, the layout is the following: profiles ... profile idauto/id build plugins .. let cargo start, deploy, undeploy, stop, etc /plugins /build /profile profile idtomcat/id activationactiveByDefaulttrue/activeByDefault/activation build plugins .. let the ant-task copy the configuration file /plugins /build /profile Now I have two problems: First, the ant-task is not the first task in the pre-integration task. It always gets executed _after_ the container is started. Second: when I execute 'mvn help:effective-pom', for the different modules, I see that all other ant tasks in every module contains the copy task. I must have completely misunderstood something very basic. How do I tell maven only to execute the ant task in this project? Thanks for any help! Greetings, Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Springmodules in Maven Repository
Hi! The current version of Springmodules is 0.6 but the Maven repository only contains the version v0.1 Is there any reason for this? If not, can I update the Maven repository as a 'normal maven user' without any permissions? If not, can I advice Maven to use the Springmodules Web Site to download the current version? Greetings Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Springmodules in Maven Repository
the project website. Then, install it using the command: mvn install:install-file -DgroupId=jboss -DartifactId=jboss-jmx \ -Dversion=4.0.3 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jboss:jboss-jmx:jar:4.0.3 12) jboss:jboss-minimal:jar:4.0.3 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=jboss -DartifactId=jboss-minimal \ -Dversion=4.0.3 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jboss:jboss-minimal:jar:4.0.3 13) jboss:jboss-system:jar:4.0.3 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=jboss -DartifactId=jboss-system \ -Dversion=4.0.3 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jboss:jboss-system:jar:4.0.3 14) jcs:jcs:jar:1.2.6.5 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=jcs -DartifactId=jcs \ -Dversion=1.2.6.5 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jcs:jcs:jar:1.2.6.5 15) xpp3:xpp3_min:jar:1.1.3.4.I Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=xpp3 -DartifactId=xpp3_min \ -Dversion=1.1.3.4.I -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) xpp3:xpp3_min:jar:1.1.3.4.I -Original Message- From: Nicolas DE LOOF [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 16. November 2006 13:29 To: Maven Users List Subject: Re: Springmodules in Maven Repository They are here : http://repo1.maven.org/maven2/org/springmodules/ Deluigi Marcus a écrit : Hi! The current version of Springmodules is 0.6 but the Maven repository only contains the version v0.1 Is there any reason for this? If not, can I update the Maven repository as a 'normal maven user' without any permissions? If not, can I advice Maven to use the Springmodules Web Site to download the current version? Greetings Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Springmodules in Maven Repository
I see. But JBoss is under LGPL and Jini is Apache License, Version 2.0 since 3/05 which should be very compatible wich Mavens license. Are there any other reasons why they aren't within Mavens repository? -Original Message- From: Nicolas DE LOOF [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 16. November 2006 14:30 To: Maven Users List Subject: Re: Springmodules in Maven Repository Spring modules has support for proprietary libs. Gigaspaces is one of them, so this artifact will never be available on maven public repository. You may fill an issue to spring JIRA for this dependency to be made optional (as lot's of others may be in this POM). A temporary solution is to install a fake jar in your repo for this lib. Deluigi Marcus a écrit : They are here : http://repo1.maven.org/maven2/org/springmodules/ Thanks for the new link. But including: 8 dependency groupIdorg.springmodules/groupId artifactIdspring-modules-cache/artifactId version0.6/version /dependency 8 Produces the following error messages. Are the dependencies broken? Missing: -- 1) gigaspaces:gigaspaces-ce:jar:5.1-1603-000 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=gigaspaces -DartifactId=gigaspaces-c -Dversion=5.1-1603-000 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) gigaspaces:gigaspaces-ce:jar:5.1-1603-000 2) jini:jsk-lib:jar:2.1 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=jini -DartifactId=jsk-lib \ -Dversion=2.1 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jini:jsk-lib:jar:2.1 3) jini:jsk-platform:jar:2.1 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=jini -DartifactId=jsk-platform \ -Dversion=2.1 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jini:jsk-platform:jar:2.1 4) jini:mahalo:jar:2.1 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=jini -DartifactId=mahalo \ -Dversion=2.1 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jini:mahalo:jar:2.1 5) jini:reggie:jar:2.1 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=jini -DartifactId=reggie \ -Dversion=2.1 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jini:reggie:jar:2.1 6) jini:start:jar:2.1 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=jini -DartifactId=start \ -Dversion=2.1 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jini:start:jar:2.1 7) jini:boot:jar:20060125 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=jini -DartifactId=boot \ -Dversion=20060125 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jini:boot:jar:20060125 8) jini:webster:jar:20060125 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=jini -DartifactId=webster \ -Dversion=20060125 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) ch.elca.caching-test:caching-test:jar:0.1-SNAPSHOT 2) org.springmodules:spring-modules-cache:jar:0.6 3) jini:webster:jar:20060125
Move tests to 'integration-test'
Hi. I have a module on which I want to execute all Junit tests in the integraton-test phase. I want to do this because I need to first start Tomcat before the test and stop it after the test. Thererefore, I put the start into the pre-integration-test phase and the stop into the post-integration-test-phase. Finally, I configured the surefire plugin to the phase 'integration-test' inside the build / tag. The module itself works fine, but when I launch the life cycle from the parent module, all tests get executed in the test phase. Can anybody give me a hint how to solve this problem? Greetings Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Let Maven wait between tests
Hi I am quite desperate: I want to let Maven sleep for a few seconds between the tests. I added this ant tasks in the build phase in a previous project and it worked fine: -8- build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-antrun-plugin/artifactId configuration tasks echo message=Sleeping now for 5 seconds: / sleep seconds=1 / echo message=1 / sleep seconds=2 / echo message=2 / sleep seconds=3 / echo message=3 / sleep seconds=4 / echo message=4 / sleep seconds=5 / echo message=5 / /tasks /configuration executions execution idwait/id phasetest/phase goals goalrun/goal /goals /execution /executions /plugin /plugins /build -8- However, in my new project, this task never gets executed and I just can't figure out why. Everything seems the same. If I change the phase from test to generate-test-sources I get the first echo task, but not the whole process. But the effective pom looks fine. Can anybody give me a hint, what might go wrong? Is there any other way to let maven wait for a few seconds between the tests? Thanks for any help! Greetings, Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Let Maven alter a config file
Hi I have Maven that has a dependency to Tomcat, i.e. retrieves Tomcat if it is not already installed. Unfortunately, I _must_ have some specific settings in the Tomcat configuration file (which is in XML). Is there any plugin that can check the files settings and alter it if necessary? Thanks for any hint! Greetings, Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Let Maven alter a config file
I have Maven that has a dependency to Tomcat, i.e. retrieves Tomcat if it is not already installed. Unfortunately, I _must_ have some specific settings in the Tomcat configuration file (which is in XML). Is there any plugin that can check the files settings and alter it if necessary? You could keep the config file in your project, and filter the correct values in at build time. (In other words, don't check them, just put in the right values.) The config file should be placed into the downloaded and extracted directory, so I think filtering is not possible. Also take a look at Cargo, which may either do what you need, or have some code you can use. Cargo seems to have the desired functionality, but I couldn't figure out how to use it. The documentation is very limited. Could someone provide an example? Thanks! Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
unable to find resource 'VM_global_library.vm'
Hi I am new to Maven and I am following the 'getting started' guide step-by-step. When I try to create the site documentation and execute: 8 mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app \ -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-site 8 I get the appended error message. Is my system corrupt or is it a maven (or plugin) bug? Everything else works fine. I have Maven v2.0.4, and Java 1.5.0_09 8 $ mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId =maven-archetype-site [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Quick Start Archetype [INFO]task-segment: [archetype:create] (aggregator-style) [INFO] [INFO] Setting property: classpath.resource.loader.class = 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on = 'false'. [INFO] Setting property: resource.loader = 'classpath'. [INFO] Setting property: resource.manager.logwhenfound = 'false'. [INFO] ** [INFO] Starting Jakarta Velocity v1.4 [INFO] RuntimeInstance initializing. [INFO] Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl) [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader [INFO] ClasspathResourceLoader : initialization starting. [INFO] ClasspathResourceLoader : initialization complete. [INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl) [INFO] Default ResourceManager initialization complete. [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach [INFO] Created: 20 parsers. [INFO] Velocimacro : initialization starting. [INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm [ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader. [INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm' [INFO] Velocimacro : VM library template macro registration complete. [INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates [INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed. [INFO] Velocimacro : initialization complete. [INFO] Velocity successfully started. [INFO] [archetype:create] [INFO] Defaulting package to group ID: com.mycompany.app [INFO] [INFO] Using following parameters for creating Archetype: maven-archetype-site:RELEASE [INFO] [INFO] Parameter: groupId, Value: com.mycompany.app [INFO] Parameter: packageName, Value: com.mycompany.app [INFO] Parameter: basedir, Value: d:\Workspace\Maven-Test\my-app [INFO] Parameter: package, Value: com.mycompany.app [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: artifactId, Value: my-app [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Error creating from archetype Embedded error: Unable to add module to the current project as it is not of packaging type 'pom' [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 2 seconds [INFO] Finished at: Tue Nov 07 10:19:18 CET 2006 [INFO] Final Memory: 4M/8M [INFO] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Debugging Maven
Hi I am quite new to Maven and I need to understand a quite large project which also happened to have a broken maven build cycle. Is there any way to: * list all user-defined goals for each phase * list all used plugins * determine which of their goals are used for which phase * skip a phase / goal There are 112 poms and the effective pom has 113177 lines, so I prefer to first retrieve a high-level abstraction. It seems as if the pre-integration-test phase is broken, so skipping a phase would be quite useful to get a basis work and then proceed to less serious problems. Greetings Marcus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]