[ 
http://jira.codehaus.org/browse/MOJO-993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=131619#action_131619
 ] 

Mark K commented on MOJO-993:
-----------------------------

I'm able to use the timestamp and buildNumber properties created by 
buildnumber-maven-plugin in some goals, but not others.

It seems to be ok when generating a MANIFEST.MF, but not when used to set a 
maven property in a text file resource (per maven-resources-plugin's filter - 
http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html).



The working bit for the manifest is

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <version>2.0.2</version>
  ...
  <archive>
    <manifestEntries>
      <Build-version>${build.version}</Build-version>



And the bit that's supposed to be substituted in webapp.properties source file 
is
  webapp.version=${build.version}



The pom defines a 'dev' profile and the build.version property like so
<profile>
  <id>dev</id>
  <properties>
    
<build.version>${project.version}-r${buildNumber}-${timestamp}</build.version>
  </properties>
</profile>


And, the results, when 'mvn package' is run with the profile activated:

META-INF/MANIFEST.MF (happy!)
  Build-version: 0.4-SNAPSHOT-r5193-1208802626628


WEB-INF/classes/webapp.properties (sad)
  webapp.version=0.4-SNAPSHOT-r${buildNumber}-${timestamp}


Seems like this is a problem with the buildnumber plugin.

> ${buildNumber} or ${timestamp} evaluate as null in maven-assembly-plugin 
> after created by buildnumber-maven-plugin
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: MOJO-993
>                 URL: http://jira.codehaus.org/browse/MOJO-993
>             Project: Mojo
>          Issue Type: Bug
>          Components: buildnumber
>         Environment: OS X 10.4.11
>            Reporter: Ellen Strnod
>
> buildnumber plugin runs & logs [INFO] Storing buildNumber: 20080108-131808 at 
> timestamp: 1199827088287, but during assembly plugin, the build number 
> evaluates as "null" when used as part of the final name:
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>${JDK_VERSION}</source>
>           <target>${JDK_VERSION}</target>
>         </configuration>
>       </plugin>
>       
>       <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>buildnumber-maven-plugin</artifactId>
>         <executions>
>           <execution>
>             <phase>validate</phase>
>             <goals>
>               <goal>create</goal>
>             </goals>
>           </execution>
>         </executions>
>         <configuration>
>           <doCheck>false</doCheck>
>           <doUpdate>false</doUpdate>
>           <format>{0,date,yyyyMMdd-HHmmss}</format>
>           <items>
>               <item>timestamp</item>
>           </items>
>         </configuration>
>       </plugin>      
>       
>       <plugin>
>         <artifactId>maven-assembly-plugin</artifactId>
>         <executions>
>           <execution>
>             <phase>assembly:assembly</phase>
>           </execution>
>         </executions>
>         <configuration>
>           <finalName>${project.build.finalName}-${timestamp}</finalName>
>           <descriptor>release.xml</descriptor>
>           <outputDirectory>release</outputDirectory>
>           <items>
>               <item>timestamp</item>
>           </items>  
>         </configuration>
>       </plugin>
>       
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-surefire-plugin</artifactId>
>         <configuration>
>           <skip>true</skip>
>           <testFailureIgnore>true</testFailureIgnore>
>           <printSummary>false</printSummary>
>           <excludes>
>             <exclude>**/*.java</exclude>
>           </excludes>
>         </configuration>
>       </plugin>
>     </plugins>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to