@@ -83,9 +83,6 @@ public class RequirementsToolMojo extends AbstractMojo {
8383 @ Parameter (property = "surefireReportsDir" , defaultValue = "${project.build.directory}/surefire-reports" )
8484 private File surefireReportsDir ;
8585
86- @ Parameter (property = "zipArtifactFilename" , defaultValue = "${project.build.finalName}-reqstool.zip" )
87- private String zipArtifactFilename ;
88-
8986 @ Parameter (defaultValue = "${project}" , required = true , readonly = true )
9087 private MavenProject project ;
9188
@@ -182,18 +179,26 @@ private void writeCombinedOutputToFile(File outputFile, JsonNode combinedOutputN
182179 }
183180
184181 private void assembleZipArtifact () throws IOException {
182+ String zipArtifactFilename = project .getBuild ().getFinalName () + "-reqstool.zip" ;
183+ String topLevelDir = project .getBuild ().getFinalName () + "-reqstool" ;
184+
185185 File zipFile = new File (outputDirectory , zipArtifactFilename );
186186 getLog ().info ("Assembling zip file: " + zipFile .getAbsolutePath ());
187187
188188 try (FileOutputStream fos = new FileOutputStream (zipFile ); ZipOutputStream zipOut = new ZipOutputStream (fos )) {
189189
190- addFileToZipArtifact (zipOut , new File (datasetPath , INPUT_FILE_REQUIREMENTS_YML ), null );
191- addFileToZipArtifact (zipOut , new File (datasetPath , INPUT_FILESOFTWARE_VERIFICATION_CASES_YML ), null );
192- addFileToZipArtifact (zipOut , new File (datasetPath , INPUT_FILE_MANUAL_VERIFICATION_RESULTS_YML ), null );
193- addFileToZipArtifact (zipOut , new File (outputDirectory , OUTPUT_FILE_ANNOTATIONS_YML_FILE ), null );
194-
195- addXmlFilesToZipArtifact (zipOut , failsafeReportsDir , new File (INPUT_DIR_TEST_RESULTS_FAILSAFE ));
196- addXmlFilesToZipArtifact (zipOut , surefireReportsDir , new File (INPUT_DIR_TEST_RESULTS_SUREFIRE ));
190+ addFileToZipArtifact (zipOut , new File (datasetPath , INPUT_FILE_REQUIREMENTS_YML ), new File (topLevelDir ));
191+ addFileToZipArtifact (zipOut , new File (datasetPath , INPUT_FILESOFTWARE_VERIFICATION_CASES_YML ),
192+ new File (topLevelDir ));
193+ addFileToZipArtifact (zipOut , new File (datasetPath , INPUT_FILE_MANUAL_VERIFICATION_RESULTS_YML ),
194+ new File (topLevelDir ));
195+ addFileToZipArtifact (zipOut , new File (outputDirectory , OUTPUT_FILE_ANNOTATIONS_YML_FILE ),
196+ new File (topLevelDir ));
197+
198+ addXmlFilesToZipArtifact (zipOut , failsafeReportsDir ,
199+ new File (topLevelDir , INPUT_DIR_TEST_RESULTS_FAILSAFE ));
200+ addXmlFilesToZipArtifact (zipOut , surefireReportsDir ,
201+ new File (topLevelDir , INPUT_DIR_TEST_RESULTS_SUREFIRE ));
197202 }
198203
199204 getLog ().info ("Assembled zip artifact: " + zipFile .getAbsolutePath ());
@@ -237,6 +242,7 @@ private void addFileToZipArtifact(ZipOutputStream zipOut, File file, File target
237242 }
238243
239244 private void attachArtifact () {
245+ String zipArtifactFilename = project .getBuild ().getFinalName () + "-reqstool.zip" ;
240246 File zipFile = new File (outputDirectory , zipArtifactFilename );
241247 getLog ().info ("Attaching artifact: " + zipFile .getName ());
242248 projectHelper .attachArtifact (project , "zip" , "reqstool" , zipFile );
0 commit comments