> -----Original Message-----
> From: Richard Allen [mailto:[EMAIL PROTECTED]
===////===
>
>
> Thanks for the reply.
>
> When you say "system properties" I think Java System
> properties, but I'm
> going to assume you mean operating system environment variables.
>
> Actually, I have been using environment variables to help
> _enable_ the
> portability of Ant scripts. We have developers that work on
> Linux, Mac,
> and Windows. We sign JARs and WARs when we build and each
> developer has
> their own keystore for building locally on their computer. When we
> release the product to the customer, we sign using a company
> keystore.
> We allow the developers to specify their own keystore, password, and
> alias via environment variables on their computer, and Ant uses those
> values for signing.
>
> In Maven, I would like to be able to do something like this:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <executions>
> <execution>
> <goals>
> <goal>sign</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <keystore>$KEYSTORE_FILE</keystore>
> <storepass>$KEYSTORE_PASS</storepass>
> <alias>$KEYSTORE_ALIAS</alias>
>
> <jarPath>${project.build.directory}/${project.build.finalName}
> .jar</jarPath>
> </configuration>
> </plugin>
>
> and have $KEYSTORE_FILE, $KEYSTORE_PASS, and $KEYSTORE_ALIAS read as
> environment variables. But Maven doesn't support this, so I had to
> create a settings.xml file with a profile that defined the three
> properties. This means that all of my developers will have to
> create a
> settings.xml of their own instead of just simply setting three
> environment variables.
>
> Another benefit of using environment variables is that I can use the
> enironment variable to specify a value that will be used both in the
> Maven build process and in some other way that doesn't involve Maven.
> For example, another environment variable that I use in the
> current Ant
> build process is $CATALINA_BASE for configuring Tomcat. This
> environment
> variable is used by both Tomcat and the build process (for
> deployment of
> a generated WAR). Using an environment variable and Ant, I
> only have to
> specify this value once. If I use Maven, I have to specify this value
> twice, as an environment variable, and in a profile in settings.xml,
> because properties specified in settings.xml can only be used
> in Maven.
>
> I don't think that incorporating environment variables in
> Maven hinders
> portability. It just depends on how people use the
> environment variables
> in the build process. There are certainly things that I could
> put in my
> pom.xml right now that would hinder portability. At some
> point you have
> to leave those decisions up to the developer trying to use
> Maven. Build
> processes can be widely different from one project to another. Adding
> support for environment variables in Maven just makes it more
> flexible,
> which means more developers will be inclined to use it.
>
> If you are worried that environment variables would clash with
> properties, then why not make the environment variables use a
> different
> syntax than the ${property} syntax?
>
> I'll look to see if there is a JIRA issue related to this topic.
>
> Thanks,
> Richard Allen
This is good idea. Maybe following the ANT methodolgy
of using a prefix ``env''. For example ${env.JAVA_HOME}
or ${env.M2_HOME} ${env.CATALINA_HOME}
==////==
--
Peter Pilgrim :: J2EE Software Development
Operations/IT - Credit Suisse First Boston,
Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom
Tel: +44-(0)207-883-4497
==============================================================================
Please access the attached hyperlink for an important electronic communications
disclaimer:
http://www.csfb.com/legal_terms/disclaimer_external_email.shtml
==============================================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]