Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-20585

Camel-package-maven-plugin: generates test configurers in non-tests artifacts

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      Change https://github.com/apache/camel/commit/0fb5aa31ae590eb042a1664ff18b6d5c44acc5c4#diff-8c376760c1f21c10dc4f6b051f972405cc04fc1ce9ca636a478cc5cfb8a1f51c

      causes that for example camel-main.jar contains test configurers like 

      org.apache.camel.main.MySecondBar, org.apache.camel.main.MySecondFoo| 

      As you can see herehttps://github.com/apache/camel/commit/0fb5aa31ae590eb042a1664ff18b6d5c44acc5c4

      different method is called.

       

      The original method was:

          public static boolean updateResource(BuildContext buildContext, Path out, String data) {
              try {
                  if (FileUtil.updateFile(out, data)) {
                      refresh(buildContext, out);
                      return true;
                  }
              } catch (IOException e) {
                  throw new IOError(e);
              }
              return false;
      

      which can not create a test resource.

      Newly called method

          protected boolean updateResource(Path dir, String fileName, String data) {
              boolean updated;
              updated = updateResource(buildContext, dir.resolve(fileName), data);
      >>>>        if (!fileName.endsWith(".java")) {
      >>>>>           Path outputDir = Paths.get(project.getBuild().getOutputDirectory());
      >>>>>           updated |= updateResource(buildContext, outputDir.resolve(fileName), data);
              }
              return updated;
      

      refreshes also resources in outputDiectorry. Therefore some test configurers are created during build of the artifact.
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            jondruse Jiri Ondrusek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: