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

java.lang.NoSuchMethodError on maven-release-plugin:3.0.0, 3.0.1 #2

Open
commonquail opened this issue Feb 29, 2024 · 0 comments
Open

Comments

@commonquail
Copy link

      <plugin>                                                                                                                                                                                                                                                                        
         <groupId>org.apache.maven.plugins</groupId>                                                                                                                                                                                                                                   
         <artifactId>maven-release-plugin</artifactId>                                                                                                                                                                                                                                 
         <version>3.0.1</version>                                                                                                                                                                                                                                                      
         <configuration>                                                                                                                                                                                                                                                               
           <projectVersionPolicyId>yearly</projectVersionPolicyId>                                                                                                                                                                                                                     
         </configuration>                                                                                                                                                                                                                                                              
         <dependencies>                                                                                                                                                                                                                                                                
           <dependency>                                                                                                                                                                                                                                                                
             <groupId>com.ncredinburgh</groupId>                                                                                                                                                                                                                                       
             <artifactId>maven-release-yearly-policy</artifactId>                                                                                                                                                                                                                      
             <version>1.0</version>                                                                                                                                                                                                                                                    
           </dependency>                                                                                                                                                                                                                                                               
           </dependency>                                                                                                                                                                                                                                                               
         </dependencies>                                                                                                                                                                                                                                                               
       </plugin>

yields

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.1:prepare (default-cli) on project foo: Execution default-cli of goal org.apache.maven.plugins:maven-release-plugin:3.0.1:prepare failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-release-plugin:3.0.1:prepare: java.lang.NoSuchMethodError: 'java.lang.String org.apache.commons.lang.StringUtils.removeEnd(java.lang.String, java.lang.String)'
...
Caused by: java.lang.NoSuchMethodError: 'java.lang.String org.apache.commons.lang.StringUtils.removeEnd(java.lang.String, java.lang.String)'
    at com.ncredinburgh.maven.release.policy.YearlyVersionPolicy.getReleaseVersion (YearlyVersionPolicy.java:40)
    at org.apache.maven.shared.release.phase.AbstractMapVersionsPhase.resolveSuggestedVersion (AbstractMapVersionsPhase.java:332)

This can be worked around to restore operation by also adding

          <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.4</version>
          </dependency
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

1 participant