Skip to content

Conversation

@xknat
Copy link

@xknat xknat commented Sep 6, 2021

It seems to be that you now must hard code the version string...

It seems to be that you now must hard code the version string...
@Andre601
Copy link
Contributor

Andre601 commented Sep 6, 2021

This.... doesn't seem good to me tbh.
Like just putting ${project.version} won't just magically work, as it also requires configuration of maven to work.

@xknat
Copy link
Author

xknat commented Sep 6, 2021

Well, currently it does throw java.lang.NullPointerException: The expansion version is null!
and this seems to fix it....
found no other way then hardcoding the version

@Andre601
Copy link
Contributor

Andre601 commented Sep 6, 2021

The issue is this line here: https://github.com/xknat/Example-Expansion/blob/patch-1/src/main/java/com/extendedclip/expansions/example/ExampleExpansion.java#L12

Again: Just replacing VERSION with ${project.version} won't solve anything. You would only replace one issue with another one. The only difference would now be, that the version would always be ${project.version}

The better solution would be to modify the pom.xml in the following way:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <finalName>${project.name}</finalName>
+                   <archive>
+                       <manifest>
+                           <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                           <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+                       </manifest>
+                   </archive>
                </configuration>
            </plugin>

@xknat xknat changed the title Return Hardcoded getVersion() with ${project.version} Fix version issue with manifest in pom Sep 15, 2021
@xknat
Copy link
Author

xknat commented Sep 15, 2021

@Andre601 thanks, that fixes it!

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

Successfully merging this pull request may close these issues.

2 participants