Search in sources :

Example 11 with ProductConfiguration

use of org.eclipse.tycho.model.ProductConfiguration in project tycho by eclipse.

the class PublishProductMojo method publishContent.

@Override
protected Collection<DependencySeed> publishContent(PublisherServiceFactory publisherServiceFactory) throws MojoExecutionException, MojoFailureException {
    Interpolator interpolator = new TychoInterpolator(getSession(), getProject());
    PublishProductTool publisher = publisherServiceFactory.createProductPublisher(getReactorProject(), getEnvironments(), getQualifier(), interpolator);
    List<DependencySeed> seeds = new ArrayList<>();
    for (File productFile : getEclipseRepositoryProject().getProductFiles(getProject())) {
        try {
            ProductConfiguration productConfiguration = ProductConfiguration.read(productFile);
            if (isEmpty(productConfiguration.getId())) {
                throw new MojoExecutionException("The product file " + productFile.getName() + " does not contain the mandatory attribute 'uid'. Please ensure you entered an id in the product file.");
            } else if (isEmpty(productConfiguration.getVersion())) {
                throw new MojoExecutionException("The product file " + productFile.getName() + " does not contain the mandatory attribute 'version'. Please ensure you entered a version in the product file.");
            }
            seeds.addAll(publisher.publishProduct(productFile, productConfiguration.includeLaunchers() ? getExpandedLauncherBinaries() : null, flavor));
        } catch (IOException e) {
            throw new MojoExecutionException("I/O exception while writing product definition or copying launcher icons", e);
        }
    }
    return seeds;
}
Also used : DependencySeed(org.eclipse.tycho.core.resolver.shared.DependencySeed) ProductConfiguration(org.eclipse.tycho.model.ProductConfiguration) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) PublishProductTool(org.eclipse.tycho.p2.tools.publisher.facade.PublishProductTool) ArrayList(java.util.ArrayList) Interpolator(org.eclipse.tycho.core.shared.Interpolator) TychoInterpolator(org.eclipse.tycho.core.maven.TychoInterpolator) IOException(java.io.IOException) TychoInterpolator(org.eclipse.tycho.core.maven.TychoInterpolator) File(java.io.File)

Aggregations

ProductConfiguration (org.eclipse.tycho.model.ProductConfiguration)11 File (java.io.File)5 Test (org.junit.Test)4 IOException (java.io.IOException)3 ArtifactDependencyVisitor (org.eclipse.tycho.core.ArtifactDependencyVisitor)3 DependencyArtifacts (org.eclipse.tycho.artifacts.DependencyArtifacts)2 ArtifactDependencyWalker (org.eclipse.tycho.core.ArtifactDependencyWalker)2 PluginDescription (org.eclipse.tycho.core.PluginDescription)2 BundleConfiguration (org.eclipse.tycho.model.BundleConfiguration)2 FeatureRef (org.eclipse.tycho.model.FeatureRef)2 InstallMode (org.eclipse.tycho.model.FeatureRef.InstallMode)2 PluginRef (org.eclipse.tycho.model.PluginRef)2 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 MavenExecutionException (org.apache.maven.MavenExecutionException)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 ArtifactDescriptor (org.eclipse.tycho.ArtifactDescriptor)1 ArtifactKey (org.eclipse.tycho.ArtifactKey)1 DefaultArtifactKey (org.eclipse.tycho.DefaultArtifactKey)1 ReactorProject (org.eclipse.tycho.ReactorProject)1