No, you are not getting it. This is about modifying the pom.xml template resource that needs the TomEE and OpenEJB versions hard coded at build time NOT the user defined ${version} that the user enters at mvn archetype:generate. Please, if you know of a better way of injecting the project versions into the template before the jar is built and deployed then please show me. You cannot use simple resource parsing as ${version} with get replaced, which we don't want, because it's a template.

It has NOTHING to do with default property/user overrides defined in the archetype-metadata!


On 23/07/2014 14:24, Romain Manni-Bucau wrote:
Sorry I don't follow (maybe read too fast)

but we can use requiredProperty (
http://maven.apache.org/archetype/maven-archetype-plugin/specification/archetype-metadata.html),
filter the descriptor to get correct default and allow then the user to
override it.

This is the way maven do it usually. Ant is a not common hack I'm still not
sure we need.




Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-07-23 14:20 GMT+02:00 Andy Gumbrecht <[email protected]>:

No, it's not the same - you are thinking of the user defined/archtype
version - Please just try it and you will see what it wrong!


Andy.

On 23/07/2014 14:15, Romain Manni-Bucau wrote:

Yeah, but we should use the archetype to query the version, said otherwise
we shouldn't use ant since maven archetype provides this feature.

Last note: since we release the archetype with tomee (which doesn't makes
sense anymore btw) we should just hardcode the version linked to the
release.



Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-07-23 14:07 GMT+02:00 Andy Gumbrecht <[email protected]>:

  No, it is the template pom - Needs the correct tomee/openejb project
versions for the plugins.  It's fixed, try the old one - quite useless
to a
newbie as the generated pom does not work - seems no one ever used it?

Andy


On 23/07/2014 13:48, Romain Manni-Bucau wrote:

  BTW not sure I follow what you do since maven archetype is able to
handle
it out of the box, why doing [VERSION]?

+ we should reuse pom of the archetype version with @version@ no?



Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-07-23 13:45 GMT+02:00 Andy Gumbrecht <[email protected]>:

   Yea it,s a mistake, and no - It's supposed to be the placeholder for
the

user defined version. Fixing now!

Andy.


On 23/07/2014 13:34, Romain Manni-Bucau wrote:

      <version>1.0-SNAPSHOT</version>?

not the first time I see something related to tomee you set to
1.0-SNAPSHOT, isn't it 2?


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


---------- Forwarded message ----------
From: <[email protected]>
Date: 2014-07-23 13:30 GMT+02:00
Subject: svn commit: r1612812 - in /tomee/tomee/trunk: ./
maven/tomee-webapp-archetype/pom.xml
maven/tomee-webapp-archetype/src/main/resources/archetype-
resources/pom.xml
To: [email protected]


Author: andygumbrecht
Date: Wed Jul 23 11:30:16 2014
New Revision: 1612812

URL: http://svn.apache.org/r1612812
Log:
Fix archetype-resources/pom.xml

Modified:
        tomee/tomee/trunk/   (props changed)
        tomee/tomee/trunk/maven/tomee-webapp-archetype/pom.xml

tomee/tomee/trunk/maven/tomee-webapp-archetype/src/main/
resources/archetype-resources/pom.xml

Propchange: tomee/tomee/trunk/
------------------------------------------------------------
------------------
      Merged /tomee/tomee/branches/tomee-1.7.x:r1612811

Modified: tomee/tomee/trunk/maven/tomee-webapp-archetype/pom.xml
URL:
http://svn.apache.org/viewvc/tomee/tomee/trunk/maven/tomee-
webapp-archetype/pom.xml?rev=1612812&r1=1612811&r2=1612812&view=diff
============================================================
==================
--- tomee/tomee/trunk/maven/tomee-webapp-archetype/pom.xml (original)
+++ tomee/tomee/trunk/maven/tomee-webapp-archetype/pom.xml Wed Jul 23
11:30:16 2014
@@ -27,4 +27,28 @@ Licensed to the Apache Software Foundati

       <artifactId>tomee-webapp-archetype</artifactId>
       <name>OpenEJB :: Maven Plugins :: TomEE Webapp Archetype</name>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>remove-apps</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <target>
+                <replace
file="${project.build.directory}/classes/archetype-resources/pom.xml"
token="[VERSION]" value="${project.version}"/>
+                </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
     </project>

Modified:
tomee/tomee/trunk/maven/tomee-webapp-archetype/src/main/
resources/archetype-resources/pom.xml
URL:
http://svn.apache.org/viewvc/tomee/tomee/trunk/maven/tomee-
webapp-archetype/src/main/resources/archetype-resources/
pom.xml?rev=1612812&r1=1612811&r2=1612812&view=diff
============================================================
==================
---
tomee/tomee/trunk/maven/tomee-webapp-archetype/src/main/
resources/archetype-resources/pom.xml
(original)
+++
tomee/tomee/trunk/maven/tomee-webapp-archetype/src/main/
resources/archetype-resources/pom.xml
Wed Jul 23 11:30:16 2014
@@ -42,7 +42,7 @@
         <dependency>
           <groupId>org.apache.openejb</groupId>
           <artifactId>arquillian-tomee-remote</artifactId>
-      <version>${version}</version>
+      <version>1.0-SNAPSHOT</version>
           <scope>test</scope>
         </dependency>
         <dependency>
@@ -104,13 +104,13 @@
           <plugin>
             <groupId>org.apache.openejb.maven</groupId>
             <artifactId>tomee-maven-plugin</artifactId>
-        <version>${version}</version>
+        <version>[VERSION]</version>
             <configuration>
               <context>ROOT</context>
             </configuration>
           </plugin>
           <plugin>
-        <groupId>org.apache.openejb</groupId>
+        <groupId>org.apache.openjpa</groupId>
             <artifactId>openjpa-maven-plugin</artifactId>
             <version>2.3.0</version>
             <configuration>


   --

     Andy Gumbrecht

     http://www.tomitribe.com
     [email protected]
     https://twitter.com/AndyGeeDe

     TomEE treibt Tomitribe! | http://tomee.apache.org



  --
    Andy Gumbrecht

    http://www.tomitribe.com
    [email protected]
    https://twitter.com/AndyGeeDe

    TomEE treibt Tomitribe! | http://tomee.apache.org



--
   Andy Gumbrecht

   http://www.tomitribe.com
   [email protected]
   https://twitter.com/AndyGeeDe

   TomEE treibt Tomitribe! | http://tomee.apache.org



--
  Andy Gumbrecht

  http://www.tomitribe.com
  [email protected]
  https://twitter.com/AndyGeeDe

  TomEE treibt Tomitribe! | http://tomee.apache.org

Reply via email to