[ 
https://jira.codehaus.org/browse/MNG-2971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=290880#comment-290880
 ] 

Julian Atienza edited comment on MNG-2971 at 2/6/12 7:06 AM:
-------------------------------------------------------------

That happens to me creating a project from an archetype from my company. Even 
having the parameters required in the archeype-metadata.xml and passing them on 
mvn archetype:generate, the resulting pom has not the parameters (groupId, 
artifactId...) replaced

This is the output from mvn archetype:generate:

Using following parameters for creating project from Archetype: 
mygroup-archetype:1.0-SNAPSHOT
[INFO] 
----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: org.myorg.mygroup.myproject
[INFO] Parameter: artifactId, Value: myproject
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: org.myorg.mygroup
[INFO] Parameter: packageInPathFormat, Value: org/myorg/mygroup
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: org.myorg.mygroup
[INFO] Parameter: groupId, Value: org.myorg.mygroup.myproject
[INFO] Parameter: artifactId, Value: myproject


this is the generated project's pom file:

<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>$org.myorg.mygroup</groupId>
  <artifactId>$mygroup-archetype</artifactId>
  <version>$1.0-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>


this is a section of the archetype-metadata.xml for my company's archetype

<archetype-descriptor
        
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0
 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd";
        name="mygroup-archetype" partial="false">
  
  <requiredProperties>
                <requiredProperty key="artifactId" />
                <requiredProperty key="groupId" />
                <requiredProperty key="package" />
        </requiredProperties>


<fileSets>
    <fileSet filtered="true" packaged="true">
      <directory>src/main/java</directory>
      <includes>
        <include>**/*.java</include>
      </includes>
    </fileSet>

     <fileSet filtered="true" packaged="true">
      <directory>src/test/java/</directory>
      <includes>
        <include>**/*.java</include>
      </includes>
    </fileSet>

    <fileSet filtered="true" packaged="true">
      <directory>/src/main/generated</directory>
      <includes>
        <include>**/*.java</include>
      </includes>
    </fileSet>
...
</<archetype-descriptor>


                
      was (Author: julianah):
    my archetype pom
                  
> Variables are not replaced into installed pom file
> --------------------------------------------------
>
>                 Key: MNG-2971
>                 URL: https://jira.codehaus.org/browse/MNG-2971
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Deployment, Inheritance and Interpolation
>         Environment: Windows, Solaris
> Maven version 2.0.4
>            Reporter: Laurent Dauvilaire
>            Assignee: Ralph Goers
>             Fix For: Issues to be reviewed for 3.x
>
>         Attachments: pom.xml
>
>
> Variables are not replaced into installed pom file.
> Here is a sample pom file
> <project xmlns="http://maven.apache.org/POM/4.0.0";
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/maven-v4_0_0.xsd";>
>       <modelVersion>4.0.0</modelVersion>
>       <groupId>com.xxx.root</groupId>
>       <artifactId>root</artifactId>
>       <packaging>pom</packaging>
>       <version>${prop.version}</version>
>       <name>My Project</name>
>         ...
>       <properties>
>               <prop.version>3.0.20</prop.version>
>       </properties>
> </project>
> The installed pom is into 
> ${localRepository}/com/xxx/root/root/3.0.20/root-3.0.20.pom
> is the same as the project pom file but the version referenced into the 
> installed pom file is ${prop.version} instead of 3.0.20
> which creates problem to artifacts depending of this one.
> Thanks in advance

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to