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

Eclipse Maven Install fails to replace built .war file, even with -SNAPSHOT version #191

Closed
JAMOGRAD opened this issue Mar 28, 2022 · 10 comments · Fixed by #194
Closed

Eclipse Maven Install fails to replace built .war file, even with -SNAPSHOT version #191

JAMOGRAD opened this issue Mar 28, 2022 · 10 comments · Fixed by #194

Comments

@JAMOGRAD
Copy link
Member

I have a Maven Java project in Eclipse, and I select the project, then "Run As->Maven install"

This runs, and "packages the webapp", "assembles the webapp","processes the war project","builds the war",

When it comes to "spring-boot-maven-plugin:2.5.4:repackage (repackage)
[INFO] Replacing main artifact with repackaged archive" it fails.

[ERROR] Failed to execute goal com.ibm.cics:cics-bundle-maven-plugin:1.0.2:bundle-war (default) on project Error writing bundle resource

If I re-run with -X I find out it is because it already exists.

This is apparently normal Maven behaviour, as it should not replace the same version. I can re-version (but that makes no sense for a development project) OR I can add -SNAPSHOT to the end of the version.

I add -SNAPSHOT to the end of the version and it works... because it creates a new file.

I do it again... and it fails because it already exists.

If I do "maven clean install" it works. Shouldn't -SNAPSHOT replace this file?

@ind1go
Copy link
Member

ind1go commented Mar 28, 2022

Please could you post the entire log, redacting areas you wouldn't want us to see?

If you can post your project, or point us at a sample project with a similar structure, that would also be appreciated.

@JAMOGRAD
Copy link
Member Author

JAMOGRAD commented Mar 28, 2022

Sure. Re-running now.

[INFO] Scanning for projects...
[INFO] 
[INFO] ---------< com.ibm.cics.cip.bank.springboot:customerservices >----------
[INFO] Building customerservices 1.1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ customerservices ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 12 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ customerservices ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ customerservices ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory *redactedLocalDirectory*\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ customerservices ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ customerservices ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-war-plugin:3.3.1:war (default-war) @ customerservices ---
[INFO] Packaging webapp
[INFO] Assembling webapp [customerservices] in [*redactedLocalDirectory*\target\customerservices-1.1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Building war: *redactedLocalDirectory*\target\customerservices-1.1.0-SNAPSHOT.war
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.5.4:repackage (repackage) @ customerservices ---
[INFO] Replacing main artifact with repackaged archive
[INFO] 
[INFO] --- cics-bundle-maven-plugin:1.0.2:bundle-war (default) @ customerservices ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.804 s
[INFO] Finished at: 2022-03-28T11:22:51+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.ibm.cics:cics-bundle-maven-plugin:1.0.2:bundle-war (default) on project customerservices: Error writing bundle resource "customerservices-1.1.0-SNAPSHOT.warbundle": *redactedLocalDirectory*\target\customerservices-1.1.0-SNAPSHOT-cics-bundle\customerservices-1.1.0-SNAPSHOT.warbundle -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@ind1go
Copy link
Member

ind1go commented Mar 28, 2022

I can reproduce this, including without Spring, so that's not the confounding factor. Same issue exists at 1.0.3.

Not sure what, if anything, has changed. We'll get a fix out.

@JAMOGRAD
Copy link
Member Author

Thanks Ben! I'm a novice at these things, and it sounded like it should have worked, hence I thought I'd better ask!

@ind1go
Copy link
Member

ind1go commented Apr 4, 2022

This should be resolved in plugin version 1.0.4-SNAPSHOT. If you're able to test that out, it would be appreciated. We will roll it up into a proper release soon.

@JAMOGRAD
Copy link
Member Author

I changed the pom to refer to the new plugin and it says "Could not find artifact com.ibm.cics:cics-bundle-maven-plugin:jar:1.0.4-SNAPSHOT". Do I need to do anything other than just updating the pom.xml to say

com.ibm.cics
cics-bundle-maven-plugin
1.0.4-SNAPSHOT

Also, should issues be closed without the raiser agreeing, or even being given a chance to comment? I had no idea this had happened, or that there was a fix waiting. It seems a bit disjointed.

@ind1go
Copy link
Member

ind1go commented Apr 11, 2022

Follow the instructions for using snapshot versions here.

@davenice
Copy link
Contributor

Also, should issues be closed without the raiser agreeing, or even being given a chance to comment? I had no idea this had happened, or that there was a fix waiting. It seems a bit disjointed.

I don't remember closing it manually - I am pretty sure it was part of the Github process automation. Hopefully you at least got the email from Ben saying that a fix was available in the SNAPSHOT! Maybe you got one saying the work item was closed, too...

I'll try and remember to comment when we merge items, if not.

@JAMOGRAD
Copy link
Member Author

I've just tried the -SNAPSHOT 1.0.4 version with my local -SNAPSHOT version and it overwrites correctly. Good job!

@ind1go
Copy link
Member

ind1go commented Apr 11, 2022

I've just tried the -SNAPSHOT 1.0.4 version with my local -SNAPSHOT version and it overwrites correctly. Good job!

Excellent, glad to hear it.

We don't have a fine granularity of issue states. And in an open source project, you can't rely on reporters verifying. We reproduced the issue, added tests to fail on the issue, and fixed the issue.

This should be resolved in plugin version 1.0.4-SNAPSHOT. If you're able to test that out, it would be appreciated. We will roll it up into a proper release soon.

This (and the notification of closure) was your notification that something had changed - if you didn't get notified, please check your notification settings, such as email!

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 a pull request may close this issue.

3 participants