Package org.apache.maven.project

Examples of org.apache.maven.project.MavenProject


               
                //mavenEmbedderRequest.setClassLoader( MavenEmbedderUtils.buildClassRealm( mavenHome.getHomeDir(), null, null ) );
               
                MavenEmbedder embedder = MavenUtil.createEmbedder( mavenEmbedderRequest );
               
                MavenProject rootProject = null;
               
                List<MavenProject> mps = new ArrayList<MavenProject>(0);
                if (maven3OrLater) {
                    mps = embedder.readProjects( pom,!this.nonRecursive );

                } else {
                    // http://issues.jenkins-ci.org/browse/HUDSON-8390
                    // we cannot read maven projects in one time for backward compatibility
                    // but we have to use a ReactorReader to get some pom with bad inheritence configured
                    MavenProject mavenProject = embedder.readProject( pom );
                    rootProject = mavenProject;
                    mps.add( mavenProject );
                    reactorReader.addProject( mavenProject );
                    if (!this.nonRecursive) {
                        readChilds( mavenProject, embedder, mps, reactorReader );
View Full Code Here


                    File path = new File(mp.getBasedir(), modulePath);
                    // HUDSON-8391 : Modules are indexed by POM path thus
                    // by default we have to add the default pom.xml file
                    if(path.isDirectory())
                      path = new File(mp.getBasedir(), modulePath+"/pom.xml");
                    MavenProject child = abslPath.get( path.getCanonicalPath());
                    if (child == null) {
                        listener.getLogger().printf(Messages.MavenModuleSetBuild_FoundModuleWithoutProject(modulePath));
                        continue;
                    }
                    toPomInfo(child,pi,abslPath,infos);
View Full Code Here

                return;
            }
            for (String module : mp.getModules()) {
                if ( Util.fixEmptyAndTrim( module ) != null ) {
                    File pomFile = new File(mp.getFile().getParent(), module);
                    MavenProject mavenProject2 = null;
                    // take care of HUDSON-8445
                    if (pomFile.isFile())
                        mavenProject2 = mavenEmbedder.readProject( pomFile );
                    else
                        mavenProject2 = mavenEmbedder.readProject( new File(mp.getFile().getParent(), module + "/pom.xml") );
View Full Code Here

        });
        return true;
    }

  private void recordParents(MavenBuildProxy build, MavenProject pom) throws IOException, InterruptedException {
    MavenProject parent = pom.getParent();
    while (parent != null) {
      File parentFile = parent.getFile();

      if (parentFile == null) {
        // Parent artifact contains no actual file, so we resolve against
        // the local repository
        ArtifactRepository localRepository = getLocalRepository(build.getMavenBuildInformation(), parent, pom);
        if (localRepository != null) {
            Artifact parentArtifact = getArtifact(parent);
          // Don't use ArtifactRepository.find(), for compatibility with Maven 2.x
            if (parentArtifact != null) {
                parentFile = new File(localRepository.getBasedir(),
              localRepository.pathOf(parentArtifact));
            }
        }
      }
     
      if (parentFile != null) {
          // we need to include the artifact Id for poms as well, otherwise a
          // project with the same groupId would override its parent's
          // fingerprint
          record(parent.getGroupId() + ":" + parent.getArtifactId(),
              parentFile, used);
      }
      parent = parent.getParent();
    }
  }
View Full Code Here

            this.eventLogger.sessionStarted(event);
           
            Map<ModuleName, MavenProject> buildingProjects = getSessionProjects(event);
           
            for (Entry<ModuleName,FilterImpl> e : this.proxies.entrySet()) {
                MavenProject project = buildingProjects.get(e.getKey());
                if (project!=null) {
                    for (MavenReporter mavenReporter : fixNull(reporters.get(e.getKey()))) {
                        try {
                            mavenReporter.preBuild( e.getValue() ,project, maven3Builder.listener);
                        } catch ( InterruptedException x ) {
View Full Code Here

            this.eventLogger.sessionEnded( event );

            Map<ModuleName, MavenProject> buildingProjects = getSessionProjects(event);

            for (Entry<ModuleName,FilterImpl> e : fixNull(this.proxies.entrySet())) {
                MavenProject project = buildingProjects.get(e.getKey());
                if (project!=null) {
                    for (MavenReporter mavenReporter : reporters.get(e.getKey())) {
                        try {
                            mavenReporter.postBuild( e.getValue() ,project, maven3Builder.listener);
                        } catch ( InterruptedException x ) {
View Full Code Here

            this.eventLogger.projectStarted( event );
           
        }
       
        private void recordProjectStarted(ExecutionEvent event) {
            MavenProject mavenProject = event.getProject();
            List<MavenReporter> mavenReporters = getMavenReporters( mavenProject );               
           
            MavenBuildProxy2 mavenBuildProxy2 = getMavenBuildProxy2( mavenProject );
            mavenBuildProxy2.start();
           
View Full Code Here

        }
       
        private void recordMojoStarted(ExecutionEvent event) {
            initMojoStartTime( event.getProject() );
           
            MavenProject mavenProject = event.getProject();
            MojoInfo mojoInfo = new MojoInfo(event);

            List<MavenReporter> mavenReporters = getMavenReporters( mavenProject );               
           
            MavenBuildProxy2 mavenBuildProxy2 = getMavenBuildProxy2( mavenProject );
View Full Code Here

            recordMojoEnded(event,null);
            this.eventLogger.mojoSucceeded( event );
        }
       
        private void recordMojoEnded(ExecutionEvent event, Exception problem) {
            MavenProject mavenProject = event.getProject();
            MojoInfo mojoInfo = new MojoInfo(event);

            recordExecutionTime(event,mojoInfo);

            List<MavenReporter> mavenReporters = getMavenReporters( mavenProject );               
View Full Code Here

        /**
         * Record how long it took to run this mojo.
         */
        private void recordExecutionTime(ExecutionEvent event, MojoInfo mojoInfo) {
            MavenProject p = event.getProject();
            List<ExecutedMojo> m = executedMojosPerModule.get(new ModuleName(p));
            if (m==null)    // defensive check
                executedMojosPerModule.put(new ModuleName(p), m=new CopyOnWriteArrayList<ExecutedMojo>());

            Long startTime = getMojoStartTime( event.getProject() );
View Full Code Here

TOP

Related Classes of org.apache.maven.project.MavenProject

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.