Re: configure Maven to dynamically select profiles
If it is runtime properties I would consider externalizing them and put them on the file system or JNDI on your application server. -ketil - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: configure Maven to dynamically select profiles
You would have to put them on your local development machine and on your CI server to be able to run the tests ofc. -ketil 2011/7/14 Ketil Aasarød ketil.aasa...@gmail.com: If it is runtime properties I would consider externalizing them and put them on the file system or JNDI on your application server. -ketil -- Med hilsen, Ketil Aasarød Fundator AS +47 930 96 411 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven 3.0 @ JavaZone
I'll be there, and I'll be sure to make room for it on my agenda. Looking forward to it :) -ketil 2009/9/4 Jason van Zyl jvan...@sonatype.com: Norway has always been a big supporter of Maven (I'm sorry about Maven 1.x) and so it's the first place that I'm going to give a talk on Maven 3.0. If you're going to JavaZone you might want to check it out: http://javazone.no/incogito09/events/JavaZone%202009/sessions/Maven%20Reloaded Thanks, Jason -- Jason van Zyl Founder, Apache Maven http://twitter.com/jvanzyl http://twitter.com/SonatypeNexus http://twitter.com/SonatypeM2E -- - 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: dependency / version problem
2009/9/4 javadevd...@googlemail.com javadevd...@googlemail.com: sorry, that i'm so annoying ;-) because this implies that at least one of the fix versions must have been changed. Thats not right (I think). Example: My dependency: DEP_A:1.0 Dependency of DEP_A = DEP_B:2.3 Dependency of DEP_B:2.3 = DEP_C:[1.0,) My dependency is fixed, and nothing changed. Some day, there is a new Version of DEP_C, so DEP_B:2.3 use this new version, because the dependency allows newer versions. As long as your project depends on A:1.0, B:2.3 and C:1.0 will be transitive dependencies. If C comes in a new version 1.1, your project will still get C:1.0 as a transitive dependency. If B wants to use C:1.1, B will come in a new version, say 2.4 that depends on C:1.1. The only way for your project to be affected by the release of C:1.1 is that A has a new release that depends on B:2.4, and your project is updated to depend on this new version of A. Do you understand the picture? -ketil - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: dependency / version problem
Sorry for overlooking the version range for dep C in my earlier post. Stephen is right. You should lock down the version of C from your pom using dependencyManagement. -ketil 2009/9/4 Stephen Connolly stephen.alan.conno...@gmail.com: Some help is available: http://mojo.codehaus.org/versions-maven-plugin/resolve-ranges-mojo.html Just prior to doing a release, you will do the following: mvn versions:resolve-ranges This will turn all the ranges into the current version (it does not handle transitive... but if you file a JIRA, we can see about adding support in a later release) That will at least help somewhat. Then you use dependency:tree to find any extra transitives, and add those into your dependencyMgnt section... -Stephen 2009/9/4 Ketil Aasarød ketil.aasa...@gmail.com 2009/9/4 javadevd...@googlemail.com javadevd...@googlemail.com: sorry, that i'm so annoying ;-) because this implies that at least one of the fix versions must have been changed. Thats not right (I think). Example: My dependency: DEP_A:1.0 Dependency of DEP_A = DEP_B:2.3 Dependency of DEP_B:2.3 = DEP_C:[1.0,) My dependency is fixed, and nothing changed. Some day, there is a new Version of DEP_C, so DEP_B:2.3 use this new version, because the dependency allows newer versions. As long as your project depends on A:1.0, B:2.3 and C:1.0 will be transitive dependencies. If C comes in a new version 1.1, your project will still get C:1.0 as a transitive dependency. If B wants to use C:1.1, B will come in a new version, say 2.4 that depends on C:1.1. The only way for your project to be affected by the release of C:1.1 is that A has a new release that depends on B:2.4, and your project is updated to depend on this new version of A. Do you understand the picture? -ketil - 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 omit generated jar version number?
In your pom.xml, add the following in the build-section: finalName${artifactId}/finalName The default value for finalName is ${artifactId}-${version}. -ketil On Tue, Aug 11, 2009 at 10:25 AM, kopemordevelopm...@knollenstein.nl wrote: I am generating a JAR artifact and in my pom.xml I should specify a version of that JAR in a version tag. However, I want Maven to generate a JAR file without the version number, i.e.FooComponent.jar. If I remove a version tag, maven reports me of an error. Is there a way to achieve what I want? Thanks, -- View this message in context: http://www.nabble.com/How-to-omit-generated-jar-version-number--tp24913645p24913645.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 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Best practices for avoiding duplicate configuration files
If A and B are only utility modules (not runnable), and you only use the log configuration files for unit testing, I would have moved them to src/test/resources in A and B. That way they are not made available to C. C will have the log configuration file in src/main/resources, at least if it is a war/ear module. Hope that helps. -ketil On Mon, Apr 27, 2009 at 1:23 PM, Stephen Connolly stephen.alan.conno...@gmail.com wrote: Create a new module(s) which just has the log configuration... then A B can both depend on this(ese) new module(s)... C can exclude the module(s) from it's dependencies on A B 2009/4/26 Olivier Cailloux olivier.caill...@ulb.ac.be Hello list, I am new to maven and couldn't find a simple and elegant solution to this (probably) common problem. I have three projects : A and B are independent projects and C depends on A and B. I use the same logging framework for the three projects (slf4j with logback). In A and B, I have a logback.xml configuration file in src/main/resources to configure logging behavior (A and B do not necessarily have the same configuration). C has also a specific logging configuration file. And, naturally, when I run the project C, logback complains that it found three logback.xml files in the classpath (the ones from A and B and C) when I would like it to find only the one from project C. I am thus wondering how to avoid this duplication of configuration files (or avoid exposure of the A and B configuration files /for dependent projects/). (Naturally completely excluding logback.xml in A and B wouldn't solve my problem as it would also exclude the configuration file when running A or B themselves.) More generally, is there some tutorial or best-practice about configuring logging for easy deployment and user-tweaking with maven? I would ideally like the end-user to be easily able to modify the logging strategy, while providing him sensible defaults. Probably the logback.xml file should not be embedded in the .jar, but I don't know how to do that (and don't know if this is the best solution!) Thank you for any pointer. Olivier - 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: sql-maven-plugin execution problem with Integration-test
You are missing a space in your sql query after the *. -ketil On Thu, Apr 23, 2009 at 10:47 AM, Karl Heinz Marbaise khmarba...@gmx.de wrote: Hi there, I have a large multi module project which is working well. Now i'm trying to enhance this with a things which is in relationship with the database... Ok i decided to take a look at the sql-maven-plugin to execute some SQL statements before an integration test is run (simply delete the contents of the databases as a first step)... But no i ran into the following problem: I have taken the configuration of the plugin from the examples page: http://mojo.codehaus.org/sql-maven-plugin/examples/execute.html I'm using Maven 2.0.10 (tested the problem with 2.0.9 with the same result). Here is the snipped from the POM.xml file: plugin groupIdorg.codehaus.mojo/groupId artifactIdsql-maven-plugin/artifactId version1.3/version dependencies dependency groupId${database.pom.groupId}/groupId artifactId${database.pom.artifactId}/artifactId version${database.pom.version}/version /dependency /dependencies configuration driver${database.driverClassName}/driver url${database.url}/url username${database.username}/username password${database.password}/password /configuration executions execution iddrop-db-before-test-if-any/id phaseprocess-test-resources/phase goals goalexecute/goal /goals configuration sqlCommandSELECT *FROM table/sqlCommand /configuration /execution /executions /plugin May be i'm completely blind and oversight things... The following is printed out: C:\DEV\workspace\.\itmvn clean integration-test Using User setting from T:/System/.m2/settings.xml Using Memory settings: -Xms256m -Xmx1024m [INFO] Scanning for projects... [INFO] [INFO] Building XXX X :: Integration Test [INFO] task-segment: [clean, integration-test] [INFO] [INFO] [clean:clean] [INFO] Deleting file-set: C:\DEV\workspace\ (included: [], excluded: []) [INFO] [cobertura:clean {execution: clean}] [INFO] [antrun:run {execution: default}] [INFO] Executed tasks [INFO] [sql:execute {execution: drop-db-before-test-if-any}] [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Ung³ltige Argumente in Aufruf [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 5 seconds [INFO] Finished at: Thu Apr 23 10:29:18 CEST 2009 [INFO] Final Memory: 19M/254M [INFO] So i have called Maven with -X [DEBUG] Configuring mojo 'org.codehaus.mojo:sql-maven-plugin:1.3:execute' -- [DEBUG] (f) autocommit = false [DEBUG] (s) delimiter = ; [DEBUG] (s) delimiterType = normal [DEBUG] (s) driver = oracle.jdbc.driver.OracleDriver [DEBUG] (s) keepFormat = false [DEBUG] (s) onError = abort [DEBUG] (s) password = X [DEBUG] (f) settings = org.apache.maven.settings.setti...@7b1641 [DEBUG] (f) skip = false [DEBUG] (f) skipOnConnectionError = false [DEBUG] (s) sqlCommand = SELECT *FROM XX [DEBUG] (s) url = jdbc:oracle:thin:@DATABASESIDX [DEBUG] -- end configuration -- [INFO] [sql:execute {execution: drop-db-before-test-if-any}] [DEBUG] connecting to jdbc:oracle:thin:@DATABASIDX [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Ung³ltige Argumente in Aufruf [INFO] [DEBUG] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Ung³ltige Argumente in Aufruf at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:584) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:500) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) at
Re: sql-maven-plugin execution problem with Integration-test
And table is a reserved word in sql, so you should insert your real table name there. -ketil On Thu, Apr 23, 2009 at 10:47 AM, Karl Heinz Marbaise khmarba...@gmx.de wrote: Hi there, I have a large multi module project which is working well. Now i'm trying to enhance this with a things which is in relationship with the database... Ok i decided to take a look at the sql-maven-plugin to execute some SQL statements before an integration test is run (simply delete the contents of the databases as a first step)... But no i ran into the following problem: I have taken the configuration of the plugin from the examples page: http://mojo.codehaus.org/sql-maven-plugin/examples/execute.html I'm using Maven 2.0.10 (tested the problem with 2.0.9 with the same result). Here is the snipped from the POM.xml file: plugin groupIdorg.codehaus.mojo/groupId artifactIdsql-maven-plugin/artifactId version1.3/version dependencies dependency groupId${database.pom.groupId}/groupId artifactId${database.pom.artifactId}/artifactId version${database.pom.version}/version /dependency /dependencies configuration driver${database.driverClassName}/driver url${database.url}/url username${database.username}/username password${database.password}/password /configuration executions execution iddrop-db-before-test-if-any/id phaseprocess-test-resources/phase goals goalexecute/goal /goals configuration sqlCommandSELECT *FROM table/sqlCommand /configuration /execution /executions /plugin May be i'm completely blind and oversight things... The following is printed out: C:\DEV\workspace\.\itmvn clean integration-test Using User setting from T:/System/.m2/settings.xml Using Memory settings: -Xms256m -Xmx1024m [INFO] Scanning for projects... [INFO] [INFO] Building XXX X :: Integration Test [INFO] task-segment: [clean, integration-test] [INFO] [INFO] [clean:clean] [INFO] Deleting file-set: C:\DEV\workspace\ (included: [], excluded: []) [INFO] [cobertura:clean {execution: clean}] [INFO] [antrun:run {execution: default}] [INFO] Executed tasks [INFO] [sql:execute {execution: drop-db-before-test-if-any}] [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Ung³ltige Argumente in Aufruf [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 5 seconds [INFO] Finished at: Thu Apr 23 10:29:18 CEST 2009 [INFO] Final Memory: 19M/254M [INFO] So i have called Maven with -X [DEBUG] Configuring mojo 'org.codehaus.mojo:sql-maven-plugin:1.3:execute' -- [DEBUG] (f) autocommit = false [DEBUG] (s) delimiter = ; [DEBUG] (s) delimiterType = normal [DEBUG] (s) driver = oracle.jdbc.driver.OracleDriver [DEBUG] (s) keepFormat = false [DEBUG] (s) onError = abort [DEBUG] (s) password = X [DEBUG] (f) settings = org.apache.maven.settings.setti...@7b1641 [DEBUG] (f) skip = false [DEBUG] (f) skipOnConnectionError = false [DEBUG] (s) sqlCommand = SELECT *FROM XX [DEBUG] (s) url = jdbc:oracle:thin:@DATABASESIDX [DEBUG] -- end configuration -- [INFO] [sql:execute {execution: drop-db-before-test-if-any}] [DEBUG] connecting to jdbc:oracle:thin:@DATABASIDX [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Ung³ltige Argumente in Aufruf [INFO] [DEBUG] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Ung³ltige Argumente in Aufruf at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:584) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:500) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142) at
Re: sql-maven-plugin execution problem with Integration-test
Well, the exception raised is caused by an SQLException, and it seems to say that you have an illegal argument in your query if my german is not all wrong. Caused by: java.sql.SQLException: Ungłltige Argumente in Aufruf -ketil On Thu, Apr 23, 2009 at 11:08 AM, Karl Heinz Marbaise khmarba...@gmx.de wrote: Hi, You are missing a space in your sql query after the *. I changed it...SELECT * FROM table, but the reaction was the same and i excepted nothing else, cause the syntax does not require a space... On the other hand the problem seemed to more located into the area of the lifecycle cause the error message is giving me such a hint... But thanks for you response... Kind regards Karl Heinz Marbaise -ketil On Thu, Apr 23, 2009 at 10:47 AM, Karl Heinz Marbaise khmarba...@gmx.de wrote: Hi there, I have a large multi module project which is working well. Now i'm trying to enhance this with a things which is in relationship with the database... Ok i decided to take a look at the sql-maven-plugin to execute some SQL statements before an integration test is run (simply delete the contents of the databases as a first step)... But no i ran into the following problem: I have taken the configuration of the plugin from the examples page: http://mojo.codehaus.org/sql-maven-plugin/examples/execute.html I'm using Maven 2.0.10 (tested the problem with 2.0.9 with the same result). Here is the snipped from the POM.xml file: plugin groupIdorg.codehaus.mojo/groupId artifactIdsql-maven-plugin/artifactId version1.3/version dependencies dependency groupId${database.pom.groupId}/groupId artifactId${database.pom.artifactId}/artifactId version${database.pom.version}/version /dependency /dependencies configuration driver${database.driverClassName}/driver url${database.url}/url username${database.username}/username password${database.password}/password /configuration executions execution iddrop-db-before-test-if-any/id phaseprocess-test-resources/phase goals goalexecute/goal /goals configuration sqlCommandSELECT *FROM table/sqlCommand /configuration /execution /executions /plugin May be i'm completely blind and oversight things... The following is printed out: C:\DEV\workspace\.\itmvn clean integration-test Using User setting from T:/System/.m2/settings.xml Using Memory settings: -Xms256m -Xmx1024m [INFO] Scanning for projects... [INFO] [INFO] Building XXX X :: Integration Test [INFO] task-segment: [clean, integration-test] [INFO] [INFO] [clean:clean] [INFO] Deleting file-set: C:\DEV\workspace\ (included: [], excluded: []) [INFO] [cobertura:clean {execution: clean}] [INFO] [antrun:run {execution: default}] [INFO] Executed tasks [INFO] [sql:execute {execution: drop-db-before-test-if-any}] [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Ungłltige Argumente in Aufruf [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 5 seconds [INFO] Finished at: Thu Apr 23 10:29:18 CEST 2009 [INFO] Final Memory: 19M/254M [INFO] So i have called Maven with -X [DEBUG] Configuring mojo 'org.codehaus.mojo:sql-maven-plugin:1.3:execute' -- [DEBUG] (f) autocommit = false [DEBUG] (s) delimiter = ; [DEBUG] (s) delimiterType = normal [DEBUG] (s) driver = oracle.jdbc.driver.OracleDriver [DEBUG] (s) keepFormat = false [DEBUG] (s) onError = abort [DEBUG] (s) password = X [DEBUG] (f) settings = org.apache.maven.settings.setti...@7b1641 [DEBUG] (f) skip = false [DEBUG] (f) skipOnConnectionError = false [DEBUG] (s) sqlCommand = SELECT *FROM XX [DEBUG] (s) url = jdbc:oracle:thin:@DATABASESIDX [DEBUG] -- end configuration -- [INFO] [sql:execute {execution: drop-db-before-test-if-any}] [DEBUG] connecting to jdbc:oracle:thin:@DATABASIDX [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Ungłltige Argumente in Aufruf [INFO] [DEBUG] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Ungłltige Argumente in Aufruf at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:584) at