views:

37

answers:

2

I packaging my java project with maven, using the M2 Plug in Eclipse

I need to provide a value for the following pom property (module_version), for local packaging this will have a value like “local-SNAPSHOT”

  <groupId>com.group</groupId>
  <artifactId>server</artifactId>
  <packaging>jar</packaging>
  <version>${module_version}</version>

Run config env variables don't seem to work...

A: 

I'm not sure what you're getting at, but if this is your base config file you should specify the version of your application within the <version>-tags. This will allow you to use that version to extract any subprojects from your local repo, as well as using the ${project.version} variable for filtering.

See here for an example of a base pom file.

mikek
+1  A: 

I am assuming that you need to specify the property module_version via the command line. In that case you can do so by typing:

$> mvn -Dmodule_version=local-SNAPSHOT package

Another way is to take it from the environment assuming you have exported the enviromnemt varialble by typing

$>export module_version=local-SNAPSHOT

An in your pom you can use:

  <groupId>com.group</groupId>
  <artifactId>server</artifactId>
  <packaging>jar</packaging>
  <version>${env.module_version}</version>
naikus