[FOLIO-2928] Maven deploy fails on mod-remote-storage master branch Created: 23/Dec/20  Updated: 05/Jan/21  Resolved: 25/Dec/20

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Bug Priority: P2
Reporter: Siarhei Charniak Assignee: Jakub Skoczen
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Blocks
blocks MODRS-2 Work with remote storage locations Closed
blocks MODRS-3 Remote storages configuration in FOLIO Closed
blocks MODRS-4 FOLIO-initiated sending items to the ... Closed
Relates
relates to FOLIO-2935 Jenkins "deploy" stage failed due to ... Closed
Sprint: DevOps: Sprint 104
Development Team: FOLIO DevOps

 Description   

Overview:
Compilation error occurs upon maven deploy on master branch after merge of MODRS-3 Closed branch (see log for details):

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/jenkins/workspace/io-org_mod-remote-storage_master/src/main/java/org/folio/rs/mapper/ConfigurationsMapper.java:[17,8] Internal error in the mapping processor: java.lang.RuntimeException: javax.annotation.processing.FilerException: Attempt to recreate a file for type org.folio.rs.mapper.ConfigurationsMapperImpl ...

Local maven build works fine.



 Comments   
Comment by Mikhail Fokanov [ 23/Dec/20 ]

My gut feeling is that it is due to Linux user, which run maven build doesn't have permissions to create files.

Comment by Sergiy Vysotskiy [ 24/Dec/20 ]

Jakub Skoczen Could you please help, who could check this ticket today or no later than Monday?

Comment by Siarhei Charniak [ 24/Dec/20 ]

This error occurs because ConfigurationsMapperImpl.class already exists in target dir. Is it possible to clean target before maven deploy?

Comment by Marc Johnson [ 24/Dec/20 ]

Siarhei Charniak

This error occurs because ConfigurationsMapperImpl.class already exists in target dir. Is it possible to clean target before maven deploy?

Does that mean this issue occurs locally if following the same steps as the Jenkins build without using a clean goal?

Comment by Siarhei Charniak [ 24/Dec/20 ]

Marc Johnson, yes

Comment by Marc Johnson [ 24/Dec/20 ]

Siarhei Charniak

Does that mean it can be fixed without the involvement of the DevOps folks by making the deploy step tolerate the pre-existence of that class?

By any chance is ConfigurationsMapperImpl generated code?

Comment by Siarhei Charniak [ 24/Dec/20 ]

Marc Johnson
ConfigurationsMapperImpl is generated class. Filer interface is used for its generation and it throws FilerException in case when target file already exists. "Maven deploy" step runs by executing mvn -DskipTests deploy command, without clean goal. As I understand, target dir (along with ConfigurationsMapperImpl in it) is already created upon previously executed "Maven build" step.

Comment by Marc Johnson [ 24/Dec/20 ]

Siarhei Charniak

ConfigurationsMapperImpl is generated class. Filer interface is used for its generation and it throws FilerException in case when target file already exists.

I've just cloned the code, this can be reproduced by issuing mvn compile twice without an intermediary clean.

My understanding is that it should be ok to execute the compile goal repeatedly without a clean with each one performing an incremental compile.

I think rather than asking the DevOps folks to change the build process, instead change the code generation to not fail on subsequent executions by not attempting to regenerate the file unless it needs to.

I'm not a maven expert, so I may be wrong about this, maybe folks like Adam Dickmeiss or Julian Ladisch can advise on this better.

Comment by Siarhei Charniak [ 25/Dec/20 ]

This issue was solved by adding maven-clean-plugin into pom.xml - https://github.com/folio-org/mod-remote-storage/pull/10
Issue can be closed.

Comment by Siarhei Charniak [ 25/Dec/20 ]

This issue was solved by adding maven-clean-plugin into pom.xml - https://github.com/folio-org/mod-remote-storage/pull/10

Generated at Thu Feb 08 23:24:18 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.