Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension #196

Open
delanym opened this issue Feb 8, 2024 · 3 comments
Open

Extension #196

delanym opened this issue Feb 8, 2024 · 3 comments

Comments

@delanym
Copy link

delanym commented Feb 8, 2024

I'm trying to set a property for the year to use in the license

  <licenses>
    <license>
      <name>Copyright © ${build.year} Millennial Technologies</name>
      <url>Stop the NPE</url>
    </license>
  </licenses>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.5.0</version>
        <configuration>
          <name>build.year</name>
          <pattern>yyyy</pattern>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

Its not working, and I noticed the plugin has no extension ability

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.5.0</version>
          <extensions>true</extensions>
        </plugin>

Half the stated goals https://www.mojohaus.org/build-helper-maven-plugin/
would not change in a session and need only be run once.

Can this ability be added?

@slawekjaranowski
Copy link
Member

@delanym do you think about: build-helper:timestamp-property - https://www.mojohaus.org/build-helper-maven-plugin/timestamp-property-mojo.html

It is not a report goal so should be in plugins sections not reporting

@slawekjaranowski
Copy link
Member

I didn't test your case but afraid that can be complicated project pom in evaluated and properties are resolved at the beginning

plugins, reports are executed after parsing

@delanym
Copy link
Author

delanym commented May 20, 2024

I tried configuring this in build section but the property is not resolved in the license for the site

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.6.0</version>
          <executions>
            <execution>
              <id>year</id>
              <goals>
                <goal>timestamp-property</goal>
              </goals>
              <phase>validate</phase>
              <configuration>
                <name>build.year</name>
                <pattern>yyyy</pattern>
                <locale>en_ZA</locale>
              </configuration>
            </execution>
          </executions>
        </plugin>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants