private BundleInfo()

in src/main/java/org/apache/jackrabbit/filevault/maven/packaging/impl/ImportPackageBuilder.java [483:514]


        private BundleInfo(Artifact artifact) throws IOException {
            id = artifact.getId();
            File file = artifact.getFile();

            // In case of an internal dependency in a multi-module project, the dependency may be represented by a directory
            // rather than a JAR file if the maven lifecycle phase does not include binding the JAR file to the dependency.
            Dependency dependency = file.isDirectory() ? new DirectoryDependency(file) : new JarBasedDependency(file);

            Manifest manifest = dependency.getManifest();
            String exportPackages = manifest == null ? null : manifest.getMainAttributes().getValue(Constants.EXPORT_PACKAGE);
            if (exportPackages != null) {
                for (Map.Entry<String, Attrs> entry : new Parameters(exportPackages).entrySet()) {
                    Attrs options = entry.getValue();
                    String version = options.getVersion();
                    packageVersions.put(entry.getKey(), version == null ? "" : version);
                }
            } else {
                // scan the class files and associate the version
                for (String path : dependency.getClassFiles()) {
                    // skip internal / impl
                    if (path.contains("/impl/") || path.contains("/internal/")) {
                        continue;
                    }
                    path = StringUtils.chomp(path, "/");
                    if (path.charAt(0) == '/') {
                        path = path.substring(1);
                    }
                    String packageName = path.replaceAll("/", ".");
                    packageVersions.put(packageName, "");
                }
            }
        }