Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ You can use Maven and add this dependency to your project's POM:
<dependency>
<groupId>com.adyen</groupId>
<artifactId>adyen-java-api-library</artifactId>
<version>39.4.0</version>
<version>39.5.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The version number is hardcoded in this example. This requires manual updates for each release and can be missed, leading to outdated documentation. Consider using a placeholder for the version, like ${project.version}, and using a Maven plugin such as maven-replacer-plugin to substitute it with the current project version during the build process. This would ensure the documentation always reflects the correct version from pom.xml.

</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
39.4.0
39.5.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This file contains a hardcoded version number, which is also defined in pom.xml. To maintain a single source of truth and simplify releases, consider generating this file automatically from the pom.xml version during your build or release process. A Maven plugin like maven-antrun-plugin could be used to write the project version into this file.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.adyen</groupId>
<artifactId>adyen-java-api-library</artifactId>
<packaging>jar</packaging>
<version>39.4.0</version>
<version>39.5.0</version>
<name>Adyen Java API Library</name>
<description>Adyen API Client Library for Java</description>
<url>https://github.com/adyen/adyen-java-api-library</url>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/adyen/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Client {
private ClientInterface httpClient;
private Config config;
public static final String LIB_NAME = "adyen-java-api-library";
public static final String LIB_VERSION = "39.4.0";
public static final String LIB_VERSION = "39.5.0";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The library version is hardcoded here, duplicating the version defined in pom.xml. This can lead to inconsistencies. A better approach is to read the version from the JAR's manifest file at runtime.

You can configure the maven-bundle-plugin in your pom.xml to add the version to the manifest:

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    ...
    <configuration>
        <instructions>
            <Export-Package>com.adyen</Export-Package>
            <Implementation-Title>${project.name}</Implementation-Title>
            <Implementation-Version>${project.version}</Implementation-Version>
        </instructions>
    </configuration>
</plugin>

Then, you can retrieve it in the code like this. This will make your release process more robust.

Suggested change
public static final String LIB_VERSION = "39.5.0";
public static final String LIB_VERSION = Client.class.getPackage().getImplementationVersion();

public static final String TERMINAL_API_ENDPOINT_TEST = "https://terminal-api-test.adyen.com";
public static final String TERMINAL_API_ENDPOINT_LIVE = "https://terminal-api-live.adyen.com";
public static final String TERMINAL_API_ENDPOINT_US = "https://terminal-api-live-us.adyen.com";
Expand Down