Package org.eclipse.tycho.packaging
Class ProductExportMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.eclipse.tycho.packaging.AbstractTychoPackagingMojo
-
- org.eclipse.tycho.packaging.ProductExportMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="product-export", threadSafe=true) public class ProductExportMojo extends AbstractTychoPackagingMojo
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
createProductArchive
private TargetEnvironment[]
environments
Deprecated.use target-platform-configurationelement private java.io.File
expandedProductFile
Location of generated .product file with all versions replaced with their expanded values.private FileLockService
fileLockService
private boolean
forcePackedDependencies
If true, all included features and bundles will be packed.private boolean
includeSources
private static java.lang.Object
LOCK
private BundleReader
manifestReader
private java.io.File
p2inf
private ProductConfiguration
productConfiguration
Parsed product configuration fileprivate java.io.File
productConfigurationFile
The product configuration, a .product file.private boolean
separateEnvironments
If true (the default), produce separate directory structure for each supported runtime environment.-
Fields inherited from class org.eclipse.tycho.packaging.AbstractTychoPackagingMojo
plexus, project, projectHelper, qualifier, session, strictBinIncludes, useDefaultExcludes
-
-
Constructor Summary
Constructors Constructor Description ProductExportMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
copyDirectory(java.io.File source, java.io.File target, java.lang.String excludes)
private void
copyExecutable(TargetEnvironment environment, java.io.File target)
private void
createProductArchive(java.io.File target, java.lang.String classifier)
void
execute()
private void
generateConfigIni(TargetEnvironment environment, java.io.File target)
private void
generateDotEclipseProduct(java.io.File target)
private void
generateOSGiBundles(java.util.Properties props, TargetEnvironment environment)
private java.util.Map<java.lang.String,PluginDescription>
getBundles(TargetEnvironment environment)
private java.lang.String
getConfig(TargetEnvironment environment)
private ArtifactDependencyWalker
getDependencyWalker(TargetEnvironment environment)
private java.util.List<TargetEnvironment>
getEnvironments()
private java.io.File
getLauncher(TargetEnvironment environment, java.io.File target)
private java.io.File
getTarget(TargetEnvironment environment)
private void
handleRootEntry(java.io.File target, java.lang.String rootFileEntries, java.lang.String subFolder)
private void
includeRootFiles(TargetEnvironment environment, java.io.File target)
Root files are files that must be packaged with an Eclipse install but are not features or plug-ins.private java.lang.StringBuffer
readFileToString(java.io.File iniFile)
private java.lang.String
removeFirstSegment(java.lang.String path)
private void
setPropertyIfNotNull(java.util.Properties properties, java.lang.String key, java.lang.String value)
private java.lang.String
toString(TargetEnvironment environment)
private void
unzipDirectory(java.io.File source, java.lang.String sourceRelPath, java.io.File target, java.lang.String excludes)
private void
writeStringToFile(java.io.File iniFile, java.lang.String string)
-
Methods inherited from class org.eclipse.tycho.packaging.AbstractTychoPackagingMojo
checkBinIncludesExist, getDependencyArtifacts, getDependencyWalker, getFileSet, getTychoProjectFacet, getTychoProjectFacet
-
-
-
-
Field Detail
-
LOCK
private static final java.lang.Object LOCK
-
productConfigurationFile
@Parameter(property="productConfiguration", defaultValue="${project.basedir}/${project.artifactId}.product") private java.io.File productConfigurationFile
The product configuration, a .product file. This file manages all aspects of a product definition from its constituent plug-ins to configuration files to branding.
-
p2inf
@Parameter(defaultValue="${productConfiguration}/../p2.inf") private java.io.File p2inf
-
expandedProductFile
@Parameter(defaultValue="${project.build.directory}/${project.artifactId}.product") private java.io.File expandedProductFile
Location of generated .product file with all versions replaced with their expanded values.
-
productConfiguration
private ProductConfiguration productConfiguration
Parsed product configuration file
-
environments
@Parameter private TargetEnvironment[] environments
Deprecated.use target-platform-configurationelement
-
createProductArchive
@Parameter(property="tycho.product.createArchive", defaultValue="true") private boolean createProductArchive
-
includeSources
@Parameter(defaultValue="false") private boolean includeSources
-
separateEnvironments
@Parameter(defaultValue="true") private boolean separateEnvironments
If true (the default), produce separate directory structure for each supported runtime environment.
-
forcePackedDependencies
@Parameter(defaultValue="false") private boolean forcePackedDependencies
If true, all included features and bundles will be packed. If false (the default), all features will be unpacked and bundles will honour unpack value ofelement.
-
manifestReader
@Component private BundleReader manifestReader
-
fileLockService
@Component private FileLockService fileLockService
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
getDependencyWalker
private ArtifactDependencyWalker getDependencyWalker(TargetEnvironment environment)
-
getEnvironments
private java.util.List<TargetEnvironment> getEnvironments()
-
getTarget
private java.io.File getTarget(TargetEnvironment environment)
-
toString
private java.lang.String toString(TargetEnvironment environment)
-
includeRootFiles
private void includeRootFiles(TargetEnvironment environment, java.io.File target) throws org.apache.maven.plugin.MojoExecutionException
Root files are files that must be packaged with an Eclipse install but are not features or plug-ins. These files are added to the root or to a specified sub folder of the build.root= root.
Not supported are the properties root.permissions and root.link.= root.folder. = root. .folder. = - Throws:
org.apache.maven.plugin.MojoExecutionException
- See Also:
://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_rootfiles .htm
-
handleRootEntry
private void handleRootEntry(java.io.File target, java.lang.String rootFileEntries, java.lang.String subFolder) throws org.apache.maven.plugin.MojoExecutionException
- Parameters:
rootFileEntry
- files and directories seperated by semicolons, the syntax is:- for a relative file: file:license.html,...
- for a absolute file: absolute:file:/eclipse/about.html,...
- for a relative folder: rootfiles,...
- for a absolute folder: absolute:/eclipse/rootfiles,...
subFolder
- the sub folder to which the root file entries are copied to- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getConfig
private java.lang.String getConfig(TargetEnvironment environment)
-
createProductArchive
private void createProductArchive(java.io.File target, java.lang.String classifier) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
generateDotEclipseProduct
private void generateDotEclipseProduct(java.io.File target) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
generateConfigIni
private void generateConfigIni(TargetEnvironment environment, java.io.File target) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
generateOSGiBundles
private void generateOSGiBundles(java.util.Properties props, TargetEnvironment environment) throws org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoFailureException
-
getBundles
private java.util.Map<java.lang.String,PluginDescription> getBundles(TargetEnvironment environment)
-
copyExecutable
private void copyExecutable(TargetEnvironment environment, java.io.File target) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
writeStringToFile
private void writeStringToFile(java.io.File iniFile, java.lang.String string) throws java.io.IOException
- Throws:
java.io.IOException
-
readFileToString
private java.lang.StringBuffer readFileToString(java.io.File iniFile) throws java.io.IOException
- Throws:
java.io.IOException
-
unzipDirectory
private void unzipDirectory(java.io.File source, java.lang.String sourceRelPath, java.io.File target, java.lang.String excludes) throws java.io.IOException
- Throws:
java.io.IOException
-
copyDirectory
private void copyDirectory(java.io.File source, java.io.File target, java.lang.String excludes) throws java.io.IOException
- Throws:
java.io.IOException
-
removeFirstSegment
private java.lang.String removeFirstSegment(java.lang.String path)
-
getLauncher
private java.io.File getLauncher(TargetEnvironment environment, java.io.File target) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
setPropertyIfNotNull
private void setPropertyIfNotNull(java.util.Properties properties, java.lang.String key, java.lang.String value)
-
-