Package org.apache.maven.bootstrap.model

Examples of org.apache.maven.bootstrap.model.Model


    File pom = new File(pomFileName);

    List<String> names = new ArrayList<String>();

    Model model = pomReader.readModel(pom, false);

    for (Object o : model.getAllDependencies()) {
      Dependency dependency = (Dependency) o;

      File file = pomReader.getArtifactFile(dependency);

      if (FileUtil.getExtension(file).equals("jar")) {
        final Manifest manifest = FileUtil.getManifest(new JarFile(file));
        if (manifest != null) {
          final Attributes mainAttributes = manifest.getMainAttributes();
          final String className = mainAttributes.getValue(Attributes.Name.MAIN_CLASS);

          if (className != null) {
            names.add(className);
          }
        }
      }
    }

    String groupId = model.getGroupId();
    String artifactId = model.getArtifactId();

    for (Iterator<String> j = names.iterator(); j.hasNext();) {
      String className = j.next();

      if (className.startsWith(groupId) || className.startsWith(groupId + "." + artifactId)) {
View Full Code Here

TOP

Related Classes of org.apache.maven.bootstrap.model.Model

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.