@@ -145,37 +145,31 @@ private static void swapReactorProjectConfiguration( MavenProject reactorProject
145145 if ( reactorProject .getProperties ().containsKey ( applyOutputDirProp ) )
146146 {
147147 String applyOutputDirectory =
148- (String ) reactorProject .getProperties ().get ( applyOutputDirProp );
148+ (String ) reactorProject .getProperties ().remove ( applyOutputDirProp );
149149 String currentOutputDirectory = reactorProject .getBuild ().getOutputDirectory ();
150150
151- // Only save to target if it doesn't already exist (prevents corruption)
152- if ( currentOutputDirectory != null
153- && !reactorProject .getProperties ().containsKey ( backupOutputDirProp ) )
151+ if ( currentOutputDirectory != null )
154152 {
155153 reactorProject .getProperties ().put ( backupOutputDirProp , currentOutputDirectory );
156154 }
157155
158- // Always set to source (idempotent, ensures correct state)
159156 reactorProject .getBuild ().setOutputDirectory ( applyOutputDirectory );
160157 }
161158
162159 if ( reactorProject .getProperties ().containsKey ( applyArtifactFileProp ) )
163160 {
164161 String applyArtifactFilePath =
165- (String ) reactorProject .getProperties ().get ( applyArtifactFileProp );
162+ (String ) reactorProject .getProperties ().remove ( applyArtifactFileProp );
166163 Artifact currentArtifact = reactorProject .getArtifact ();
167164
168- // Only save to target if it doesn't already exist (prevents corruption)
169- if ( currentArtifact != null
170- && !reactorProject .getProperties ().containsKey ( backupArtifactFileProp ) )
165+ if ( currentArtifact != null )
171166 {
172167 File currentArtifactFile = currentArtifact .getFile ();
173168 reactorProject .getProperties ().put ( backupArtifactFileProp ,
174169 currentArtifactFile == null ? ""
175170 : currentArtifactFile .getAbsolutePath () );
176171 }
177172
178- // Always set to source (idempotent, ensures correct state)
179173 reactorProject .getArtifact ().setFile ( "" .equals ( applyArtifactFilePath ) ? null
180174 : new File ( applyArtifactFilePath ) );
181175 }
0 commit comments