Package org.jboss.forge.addon.maven.resources

Examples of org.jboss.forge.addon.maven.resources.MavenModelResource


   @Override
   public void setModel(final Model pom)
   {
      MavenXpp3Writer writer = new MavenXpp3Writer();
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      MavenModelResource modelResource = getModelResource();
      try (Writer fw = new OutputStreamWriter(outputStream))
      {
         writer.write(fw, pom);
         modelResource.setContents(outputStream.toString());
      }
      catch (IOException e)
      {
         throw new RuntimeException("Could not write POM file: " + modelResource.getFullyQualifiedName(), e);
      }
      finally
      {
         buildManager.evictFromCache(modelResource);
      }
View Full Code Here


   @Override
   public boolean install()
   {
      if (!isInstalled())
      {
         MavenModelResource pom = getModelResource();
         if (!pom.createNewFile())
            throw new IllegalStateException("Could not create POM file.");
         pom.setContents(createDefaultPOM());
         monitor = pom.monitor();
         listenerRegistration = monitor.addResourceListener(new ResourceListener()
         {
            @Override
            public void processEvent(ResourceEvent event)
            {
View Full Code Here

   }

   @Override
   public boolean isInstalled()
   {
      MavenModelResource pom = getModelResource();
      return pom != null && pom.exists();
   }
View Full Code Here

   {
      if (this.buildingResult == null)
      {
         ProjectBuildingRequest request = null;
         request = getRequest();
         MavenModelResource pomResource = getModelResource();
         if (request != null)
         {
            try
            {
               request.setResolveDependencies(true);
               // FORGE-1287
               // buildingResult = getBuilder().build(new FileResourceModelSource(pomResource), request);
               buildingResult = getBuilder().build(pomResource.getUnderlyingResourceObject(), request);
            }
            catch (RuntimeException full)
            {
               throw full;
            }
View Full Code Here

   @Override
   public boolean install()
   {
      if (!isInstalled())
      {
         MavenModelResource pom = getModelResource();
         if (!pom.createNewFile())
            throw new IllegalStateException("Could not create POM file.");
         pom.setContents(createDefaultPOM());
      }
      return isInstalled();
   }
View Full Code Here

   }

   @Override
   public boolean isInstalled()
   {
      MavenModelResource pom = getModelResource();
      return pom != null && pom.exists();
   }
View Full Code Here

   @Override
   public void setModel(final Model pom)
   {
      MavenXpp3Writer writer = new MavenXpp3Writer();
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      MavenModelResource modelResource = getModelResource();
      try (Writer fw = new OutputStreamWriter(outputStream))
      {
         writer.write(fw, pom);
         modelResource.setContents(outputStream.toString());
      }
      catch (IOException e)
      {
         throw new RuntimeException("Could not write POM file: " + modelResource.getFullyQualifiedName(), e);
      }
      finally
      {
         buildManager.evictFromCache(modelResource);
      }
View Full Code Here

   @Override
   public boolean install()
   {
      if (!isInstalled())
      {
         MavenModelResource pom = getModelResource();
         if (!pom.createNewFile())
            throw new IllegalStateException("Could not create POM file.");
         pom.setContents(createDefaultPOM());
      }
      return isInstalled();
   }
View Full Code Here

   }

   @Override
   public boolean isInstalled()
   {
      MavenModelResource pom = getModelResource();
      return pom != null && pom.exists();
   }
View Full Code Here

   @Override
   public void setModel(final Model pom)
   {
      MavenXpp3Writer writer = new MavenXpp3Writer();
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      MavenModelResource modelResource = getModelResource();
      try (Writer fw = new OutputStreamWriter(outputStream))
      {
         writer.write(fw, pom);
         modelResource.setContents(outputStream.toString());
      }
      catch (IOException e)
      {
         throw new RuntimeException("Could not write POM file: " + modelResource.getFullyQualifiedName(), e);
      }
      finally
      {
         buildManager.evictFromCache(modelResource);
      }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.maven.resources.MavenModelResource

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.