Alfresco / alfresco-sdk

The Alfresco In-Process SDK is based on Apache Maven, includes support for rapid and standard development, testing, packaging, versioning and release of your Alfresco integration and extension projects
Apache License 2.0
185 stars 113 forks source link

Share image doesn't have the project's generated jar updated after changing the project's version #549

Closed douglascrp closed 5 years ago

douglascrp commented 5 years ago

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request

Expected Behavior

Once the project's version is changed from 1.0-SNAPSHOT into something else, the resulting image should have the generated artifact updated.

Current Behavior

Just like with the alfresco-jar artifact, the share-jar artifact has the version hard-coded inside the section below:

<execution>
    <id>copy-repo-extension</id>
    <phase>pre-integration-test</phase>
    <goals>
        <goal>copy</goal>
    </goals>
    <configuration>
        <artifactItems>
            <artifactItem>
                <groupId>br.com.dgcloud</groupId>
                <artifactId>project-share</artifactId>
                <version>1.0-SNAPSHOT</version>
                <overWrite>false</overWrite>
                <outputDirectory>${project.build.directory}/extensions</outputDirectory>
            </artifactItem>
         </artifactItems>
     </configuration>
</execution>

This is similar to what is described in https://github.com/Alfresco/alfresco-sdk/issues/548

Possible Solution

Replacing the hard coded version with ${project.version} would fix the issue, just like:

<execution>
    <id>copy-repo-extension</id>
    <phase>pre-integration-test</phase>
    <goals>
        <goal>copy</goal>
    </goals>
    <configuration>
        <artifactItems>
            <artifactItem>
                <groupId>br.com.dgcloud</groupId>
                <artifactId>project-share</artifactId>
                <version>${project.version}</version>
                <overWrite>false</overWrite>
                <outputDirectory>${project.build.directory}/extensions</outputDirectory>
            </artifactItem>
         </artifactItems>
     </configuration>
</execution>

Steps to Reproduce (for bugs)

  1. Create a new jar share project, setting version as 1.0-SNAPSHOT
  2. Execute the project using ./run.sh build_start
  3. Stop the project
  4. Change the project's version to 1.0
  5. Execute the project again

Context

Your Environment

ohej commented 5 years ago

Fixed in #555