All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.versioneye.mojo.SprayioMojo Maven / Gradle / Ivy

Go to download

The maven-indexer project is used by VersionEye to download, read and iterate Maven indexes from Maven repository servers. This project is part of the VersionEye crawling framework.

There is a newer version: 1.1.5
Show newest version
package com.versioneye.mojo;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.versioneye.persistence.IMavenRepostoryDao;
import com.versioneye.persistence.IProductDao;
import com.versioneye.service.ProductService;

@Mojo( name = "sprayio", defaultPhase = LifecyclePhase.PROCESS_SOURCES )
public class SprayioMojo extends CentralMojo {

    static final Logger logger = LogManager.getLogger(SprayioMojo.class.getName());

    public void execute() throws MojoExecutionException, MojoFailureException {
        try{
            ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
            productService = (ProductService) context.getBean("productService");
            mavenRepositoryDao = (IMavenRepostoryDao) context.getBean("mavenRepositoryDao");
            productDao = (IProductDao) context.getBean("productDao");

            mavenRepository = mavenRepositoryDao.findByName("sprayio");

            addRepo(mavenRepository);

            super.doUpdateFromIndex();
        } catch( Exception exception ){
            logger.error(exception);
            throw new MojoExecutionException("Oh no! Something went wrong. Get in touch with the VersionEye guys and give them feedback.", exception);
        }
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy