private void writeArtifact(Path path) {
        String pathStr = path.toString();
        final String outputPath = pathStr.substring(pathStr.lastIndexOf(getPluginName())
                + getPluginName().length()
                + 1);
        try {
            // Resources are written to the class output
            if (outputPath.startsWith("META-INF")) {
                try (Writer writer = filer
                        .createResource(StandardLocation.CLASS_OUTPUT, "", convertOutputPath(outputPath))
                        .openWriter()) {
                    writer.write(IoUtils.readUtf8File(path));
                }
                // All other Java files are written to the source output
            } else if (outputPath.endsWith(".java")) {
                // The filer needs to use a namespace convention of `.` rather than the default separator for paths.
                String javaPath = outputPath.replace(FileSystems.getDefault().getSeparator(), ".")
                        .substring(0, outputPath.lastIndexOf(".java"));
                try (Writer writer = filer.createSourceFile(javaPath).openWriter()) {
                    writer.write(IoUtils.readUtf8File(path));
                }
            } else {
                // Non-java files generated are ignored.
                messager.printMessage(Diagnostic.Kind.NOTE, "Ignoring generated file: " + outputPath);
            }
        } catch (IOException exc) {
            throw new UncheckedIOException(exc);
        }
    }
Maps annotation data to a plugin configuration node.

@param annotation instance of generator annotation to use to create the build config.
@return ObjectNode to use as plugin configuration node.
smithy-build/src/main/java/software/amazon/smithy/build/processor/SmithyAnnotationProcessor.java