From bb5d9c8b024eac5b557143b952b9464eb84639ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Sun, 4 Feb 2024 17:30:28 +0100 Subject: [PATCH] Prepare Tycho for upcomming p2 source requirements changes --- .../eclipse/tycho/IArtifactFileProvider.java | 2 +- .../tycho/IRawArtifactFileProvider.java | 4 +-- .../eclipse/tycho/IRawArtifactProvider.java | 2 +- .../org/eclipse/tycho/TargetPlatform.java | 2 +- .../maven/plugin/AbstractCompilerMojo.java | 6 ++-- .../compiler/AbstractOsgiCompilerMojo.java | 2 +- .../tycho/core/TychoProjectManager.java | 5 ++++ .../core/ee/impl/InvalidEENameException.java | 2 +- ...aultTargetPlatformConfigurationReader.java | 2 +- .../repository/MirroringArtifactProvider.java | 2 +- .../module/ModuleArtifactRepository.java | 2 +- .../module/ModuleMetadataRepository.java | 4 +-- .../streaming/ArtifactSinkFactory.java | 4 +-- .../AbstractDirectorApplicationCommand.java | 20 ++++++++++--- .../director/shared/DirectorRuntime.java | 7 +++++ .../p2/tools/publisher/ExpandedProduct.java | 6 ++-- .../AbstractResolutionStrategy.java | 1 + .../tycho/extras/docbundle/JavadocMojo.java | 30 +++++++++---------- .../p2/director/AbstractProductMojo.java | 10 +++---- .../plugins/p2/director/DirectorMojo.java | 8 ++++- .../p2/director/MaterializeProductsMojo.java | 14 +++++++-- .../tycho/plugins/p2/director/Product.java | 2 +- .../tycho/plugins/p2/BaselineValidator.java | 2 +- .../p2/publisher/PublishCategoriesMojo.java | 2 +- .../p2/publisher/PublishProductMojo.java | 2 +- .../p2/repository/AssembleRepositoryMojo.java | 2 +- .../tycho/packaging/PackageFeatureMojo.java | 6 ++-- .../eclipse/tycho/source/OsgiSourceMojo.java | 4 +-- .../tycho/source/SourceFeatureMojo.java | 4 +-- .../surefire/AbstractEclipseTestMojo.java | 10 +++---- .../tycho/surefire/TestPluginMojo.java | 6 ++-- .../surefire/TychoIntegrationTestMojo.java | 6 ++-- .../targetplatform/TargetDefinition.java | 2 +- .../targetplatform/TargetPlatformFilter.java | 4 +-- .../tycho/test/util/EnvironmentUtil.java | 2 +- .../tycho/test/util/P2RepositoryTool.java | 2 +- .../tycho/versions/SetVersionMojo.java | 6 ++-- 37 files changed, 118 insertions(+), 79 deletions(-) diff --git a/tycho-api/src/main/java/org/eclipse/tycho/IArtifactFileProvider.java b/tycho-api/src/main/java/org/eclipse/tycho/IArtifactFileProvider.java index 6c652f069e..d8b31f2eb7 100644 --- a/tycho-api/src/main/java/org/eclipse/tycho/IArtifactFileProvider.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/IArtifactFileProvider.java @@ -21,7 +21,7 @@ * *

* Over {@link IArtifactProvider}, this interface adds a method for obtaining the artifacts as files - * in the local file system. (With the IArtifactProvider interface, artifacts can only be + * in the local file system. (With the IArtifactProvider interface, artifacts can only be * obtained as stream.) *

*/ diff --git a/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactFileProvider.java b/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactFileProvider.java index 9994af0f48..ef970ae30e 100644 --- a/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactFileProvider.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactFileProvider.java @@ -21,13 +21,13 @@ * *

* Over {@link IArtifactFileProvider}, this interface adds methods for obtaining artifacts in raw - * formats. (With the IArtifactFileProvider interface, artifacts can only be obtained in + * formats. (With the IArtifactFileProvider interface, artifacts can only be obtained in * the canonical format, i.e. the format in which the artifact can be used directly without * additional decompression.) *

*

* Over {@link IRawArtifactProvider}, this interface adds a method for obtaining the artifacts as - * files in the local file system. (With the IRawArtifactProvider interface, artifacts can + * files in the local file system. (With the IRawArtifactProvider interface, artifacts can * only be obtained as stream.) *

*/ diff --git a/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactProvider.java b/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactProvider.java index 3e7c3fcc7f..c9b1b3cb68 100644 --- a/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactProvider.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/IRawArtifactProvider.java @@ -22,7 +22,7 @@ * *

* Over {@link IArtifactProvider}, this interface adds methods for obtaining artifacts in raw - * formats. (With the IArtifactProvider interface, artifacts can only be obtained in the + * formats. (With the IArtifactProvider interface, artifacts can only be obtained in the * canonical format, i.e. the format in which the artifact can be used directly without additional * decompression.) *

diff --git a/tycho-api/src/main/java/org/eclipse/tycho/TargetPlatform.java b/tycho-api/src/main/java/org/eclipse/tycho/TargetPlatform.java index ffbb72eb09..dbc68ee319 100644 --- a/tycho-api/src/main/java/org/eclipse/tycho/TargetPlatform.java +++ b/tycho-api/src/main/java/org/eclipse/tycho/TargetPlatform.java @@ -73,7 +73,7 @@ ArtifactKey resolveArtifact(String type, String id, String versionRef) * Returns the file system location of the given target platform artifact. * * @return the location of the given artifact, or null if the artifact does not - * exist in the target platform, or if the given ArtifactKey refers to an + * exist in the target platform, or if the given ArtifactKey refers to an * metadata-only "artifact" e.g. a product definition. */ File getArtifactLocation(ArtifactKey artifact); diff --git a/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java b/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java index b3daec6d0c..64ad0ab32a 100644 --- a/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java +++ b/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java @@ -183,10 +183,10 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { private String executable; /** - * If only is specified, the annotation processors will run but no compilation will be - * performed. If none is specified, annotation processors will not be discovered or + * If only is specified, the annotation processors will run but no compilation will be + * performed. If none is specified, annotation processors will not be discovered or * run; compilation will proceed as if no annotation processors were found. By default the - * compiler must search the classpath for annotation processors, so specifying none may + * compiler must search the classpath for annotation processors, so specifying none may * speed compilation if annotation processing is not required. This parameter requires a 1.6 VM * or above and is used only if the compliance is 1.6 * diff --git a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java index e14f8371f6..97d8db75e2 100644 --- a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java +++ b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java @@ -167,7 +167,7 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl * * * The default value of the bootclasspath used for compilation is - * <jdkHome>/lib/*;<jdkHome>/lib/ext/*;<jdkHome>/lib/endorsed/* . + * <jdkHome>/lib/*;<jdkHome>/lib/ext/*;<jdkHome>/lib/endorsed/* . * * For JDKs with different filesystem layouts, the bootclasspath can be specified explicitly in * the configuration section. diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/TychoProjectManager.java b/tycho-core/src/main/java/org/eclipse/tycho/core/TychoProjectManager.java index 0565d42e79..4cc4a30331 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/TychoProjectManager.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/TychoProjectManager.java @@ -59,6 +59,7 @@ import org.eclipse.tycho.core.osgitools.OsgiManifest; import org.eclipse.tycho.core.osgitools.OsgiManifestParserException; import org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader; +import org.eclipse.tycho.core.resolver.shared.IncludeSourceMode; import org.eclipse.tycho.helper.PluginRealmHelper; import org.eclipse.tycho.model.project.EclipseProject; import org.eclipse.tycho.targetplatform.TargetDefinition; @@ -161,6 +162,10 @@ private Map getProfileProperties(TargetEnvironment environment, TargetPlatformConfiguration configuration) { Map properties = environment.toFilterProperties(); properties.put("org.eclipse.update.install.features", "true"); + IncludeSourceMode sourceMode = configuration.getTargetDefinitionIncludeSourceMode(); + if (sourceMode == IncludeSourceMode.force || sourceMode == IncludeSourceMode.honor) { + properties.put("org.eclipse.update.install.sources", "true"); + } properties.putAll(configuration.getProfileProperties()); return properties; } diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/InvalidEENameException.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/InvalidEENameException.java index 14fd4dc3c0..d927ad3e71 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/InvalidEENameException.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/impl/InvalidEENameException.java @@ -15,7 +15,7 @@ /** * Thrown if a custom execution environment name does not comply to format - * <name>-<version>, with name not containing dashes (-) and version being a + * <name>-<version>, with name not containing dashes (-) and version being a * valid OSGi version. */ public class InvalidEENameException extends RuntimeException { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java index c9cd9d6863..dceb0cc3ac 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java @@ -332,7 +332,7 @@ private void setBREEHeaderSelectionPolicy(TargetPlatformConfiguration result, Xp /** * Take the constraints of the configured execution environment into account when resolving * dependencies or target definitions. These constraints include the list of system packages and - * the Bundle-RequiredExecutionEnvironment header. When set to true, the + * the Bundle-RequiredExecutionEnvironment header. When set to true, the * dependency resolution verifies that the bundle and all required bundles can be used in an * OSGi container with the configured execution environment. */ diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/MirroringArtifactProvider.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/MirroringArtifactProvider.java index 055afd5751..0bb2945664 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/MirroringArtifactProvider.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/MirroringArtifactProvider.java @@ -61,7 +61,7 @@ * repository. * *

- * Note that a MirroringArtifactProvider is not a transparent cache of the remote + * Note that a MirroringArtifactProvider is not a transparent cache of the remote * providers. The content provided by this instance differs from the remote providers' content in * the following ways: *

    diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepository.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepository.java index 3dd2e6fa25..fe2aa5fe08 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepository.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleArtifactRepository.java @@ -50,7 +50,7 @@ * A p2 artifact repository implementation for the build output directory. Instances are persisted * in the following files: *
      - *
    • A p2artifacts.xml file in the given build target directory, which contains a list of + *
    • A p2artifacts.xml file in the given build target directory, which contains a list of * all artifacts with p2 and Maven coordinates. (In particular the classifier part of the * Maven coordinates is relevant.) This file is deployed to Maven repositories alongside with the * built Tycho artifact.
    • diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepository.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepository.java index 31bf53b783..9f25c18977 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepository.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/module/ModuleMetadataRepository.java @@ -37,8 +37,8 @@ import org.eclipse.tycho.p2.repository.MetadataIO; /** - * A p2 metadata repository implementation which is persisted in a p2content.xml. The - * p2content.xml is the file that is deployed to Maven repositories alongside with the + * A p2 metadata repository implementation which is persisted in a p2content.xml. The + * p2content.xml is the file that is deployed to Maven repositories alongside with the * built Tycho artifact. * * @see TychoConstants#FILE_NAME_P2_METADATA diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/streaming/ArtifactSinkFactory.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/streaming/ArtifactSinkFactory.java index 87945c39df..a1ff768c21 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/streaming/ArtifactSinkFactory.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/repository/streaming/ArtifactSinkFactory.java @@ -34,7 +34,7 @@ public final class ArtifactSinkFactory { * The key of the artifact to be written. * @param destination * The output stream to write the artifact content to. The ownership of the stream is - * not transferred, i.e. neither this method nor the returned IArtifactSink + * not transferred, i.e. neither this method nor the returned IArtifactSink * will call {@link OutputStream#close()} on the stream. */ public static IArtifactSink writeToStream(IArtifactKey artifactKey, OutputStream destination) { @@ -55,7 +55,7 @@ public static IArtifactSink writeToStream(IArtifactKey artifactKey, OutputStream * An {@link IArtifactDescriptor} specifying artifact and format to be written. * @param destination * The output stream to write the raw content to. The ownership of the stream is not - * transferred, i.e. neither this method nor the returned IRawArtifactSink + * transferred, i.e. neither this method nor the returned IRawArtifactSink * will call {@link OutputStream#close()} on the stream. */ public static IRawArtifactSink rawWriteToStream(IArtifactDescriptor artifactDescriptor, OutputStream destination) { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/AbstractDirectorApplicationCommand.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/AbstractDirectorApplicationCommand.java index 965d526ddd..ede984fa86 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/AbstractDirectorApplicationCommand.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/AbstractDirectorApplicationCommand.java @@ -14,10 +14,10 @@ import java.io.File; import java.net.URI; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.StringJoiner; +import java.util.TreeMap; import java.util.stream.Collectors; import org.eclipse.equinox.p2.engine.IPhaseSet; @@ -45,6 +45,7 @@ public abstract class AbstractDirectorApplicationCommand implements DirectorRunt private File destination; private File bundlePool; private IPhaseSet phaseSet; + private boolean installSources; @Override public final void addMetadataSources(Iterable metadataRepositories) { @@ -93,6 +94,11 @@ public final void setInstallFeatures(boolean installFeatures) { this.installFeatures = installFeatures; } + @Override + public void setInstallSources(boolean installSources) { + this.installSources = installSources; + } + @Override public final void setVerifyOnly(boolean verifyOnly) { this.verifyOnly = verifyOnly; @@ -136,8 +142,7 @@ protected List getDirectorApplicationArguments() { args.addUnlessEmpty("-installIU", unitsToInstall); args.add("-destination", destination.getAbsolutePath()); args.add("-profile", profileName); - Map props = new HashMap<>(this.profileProperties); - props.put("org.eclipse.update.install.features", Boolean.toString(installFeatures)); + Map props = getProfileProperties(); args.add("-profileProperties", props.entrySet().stream().map(entry -> entry.getKey() + '=' + entry.getValue()) .collect(Collectors.joining(","))); args.add("-roaming"); @@ -153,8 +158,15 @@ protected List getDirectorApplicationArguments() { args.add("-p2.ws", environment.getWs()); args.add("-p2.arch", environment.getArch()); } - return args.asList(); } + @Override + public Map getProfileProperties() { + Map props = new TreeMap<>(this.profileProperties); + props.put("org.eclipse.update.install.features", Boolean.toString(installFeatures)); + props.put("org.eclipse.update.install.sources", Boolean.toString(installSources)); + return props; + } + } diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorRuntime.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorRuntime.java index 0b261abf82..f87bdab8a1 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorRuntime.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/director/shared/DirectorRuntime.java @@ -55,7 +55,14 @@ public interface Command { void setProfileProperties(Map profileProperties); + /** + * @return a copy of the effective profile properties + */ + Map getProfileProperties(); + void setPhaseSet(IPhaseSet phaseSet); + + void setInstallSources(boolean installSources); } /** diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExpandedProduct.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExpandedProduct.java index 7126972100..78d9526369 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExpandedProduct.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/tools/publisher/ExpandedProduct.java @@ -86,10 +86,10 @@ public List getFeatures() { public List getFeatures(int options) { if (options == INCLUDED_FEATURES) { return expandedFeatures; - } else { - // currently not needed by the publisher action -> omitted for simplicity - throw new UnsupportedOperationException(); + } else if (options == IProductDescriptor.ROOT_FEATURES) { + return Collections.unmodifiableList(expandedRootFeatures); } + return List.of(); } public List getRootFeatures() { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/AbstractResolutionStrategy.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/AbstractResolutionStrategy.java index 2e037142da..ee2ee3b2ae 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/AbstractResolutionStrategy.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/AbstractResolutionStrategy.java @@ -71,6 +71,7 @@ protected abstract Collection resolve(Map prop private Map getEffectiveFilterProperties(TargetEnvironment environment) { Map result = environment.toFilterProperties(); result.put("org.eclipse.update.install.features", "true"); + result.put("org.eclipse.update.install.sources", "true"); insertAdditionalFilterProperties(result); return result; } diff --git a/tycho-extras/tycho-document-bundle-plugin/src/main/java/org/eclipse/tycho/extras/docbundle/JavadocMojo.java b/tycho-extras/tycho-document-bundle-plugin/src/main/java/org/eclipse/tycho/extras/docbundle/JavadocMojo.java index d8541515de..f22361df23 100644 --- a/tycho-extras/tycho-document-bundle-plugin/src/main/java/org/eclipse/tycho/extras/docbundle/JavadocMojo.java +++ b/tycho-extras/tycho-document-bundle-plugin/src/main/java/org/eclipse/tycho/extras/docbundle/JavadocMojo.java @@ -51,11 +51,11 @@ *

      * The javadoc executable path is determined in this order: *

        - *
      • executable argument of the javadocOptions configuration + *
      • executable argument of the javadocOptions configuration * element, if available
      • *
      • active Maven toolchain
      • - *
      • java.home system property
      • - *
      • JAVA_HOME environment setting
      • + *
      • java.home system property
      • + *
      • JAVA_HOME environment setting
      • *
      • if none of the above can be used, the javadoc executable is invoked * without an explicit path and relies on the operating system PATH * variable
      • @@ -116,19 +116,19 @@ public class JavadocMojo extends AbstractMojo { * Options for calling the javadoc application. Possible options are (all * options are optional): *
          - *
        • ignoreError, specifies if errors calling javadoc should be + *
        • ignoreError, specifies if errors calling javadoc should be * ignored
        • - *
        • doclet, used as javadoc -doclet parameter
        • - *
        • docletArtifacts, dependencies will be resovled and added as - * -docletpath parameter
        • - *
        • encoding, used as javadoc -encoding parameter (default: - * ${project.build.sourceEncoding}
        • - *
        • additionalArguments, a list of additional arguments passed to + *
        • doclet, used as javadoc -doclet parameter
        • + *
        • docletArtifacts, dependencies will be resovled and added as + * -docletpath parameter
        • + *
        • encoding, used as javadoc -encoding parameter (default: + * ${project.build.sourceEncoding}
        • + *
        • additionalArguments, a list of additional arguments passed to * javadoc
        • - *
        • includes/excludes, the list of names of packages to be - * included in or excluded from JavaDoc processing; use '*' character + *
        • includes/excludes, the list of names of packages to be + * included in or excluded from JavaDoc processing; use '*' character * as wildcard
        • - *
        • executable, the javadoc executable path to be used (see mojo + *
        • executable, the javadoc executable path to be used (see mojo * description for the default path calculation)
        • *
        * Example configuration: @@ -168,9 +168,9 @@ public class JavadocMojo extends AbstractMojo { /** * Options for creating the toc files. *
          - *
        • mainLabel, specifies the main label of the toc file (default: + *
        • mainLabel, specifies the main label of the toc file (default: * "API Reference")
        • - *
        • mainFilename, specifies the filename of the TOC file (default: + *
        • mainFilename, specifies the filename of the TOC file (default: * "overview-summary.html") *
        * Example configuration: diff --git a/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/AbstractProductMojo.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/AbstractProductMojo.java index dc93851625..5b012d0976 100644 --- a/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/AbstractProductMojo.java +++ b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/AbstractProductMojo.java @@ -42,7 +42,7 @@ abstract class AbstractProductMojo extends AbstractMojo { *

        * If the project contains more than one product file, you need to choose for which ones you * want to create distribution archives. If you choose to install more than one product, you - * need to specify the attachId (which becomes a part of the classifier) to make the + * need to specify the attachId (which becomes a part of the classifier) to make the * classifiers unique. Example: * *

        @@ -98,11 +98,11 @@ abstract class AbstractProductMojo extends AbstractMojo {
              * 
              * Details on the product-specific configuration parameters:
              * 
          - *
        • rootFolder - The path where the installed product shall be stored in the + *
        • rootFolder - The path where the installed product shall be stored in the * archive, e.g. "eclipse". By default, the product is stored in the archive root.
        • - *
        • rootFolders - OS-specific installation root folders, overriding - * rootFolder. Allowed children are <macosx>, <win32>, - * <linux> and <freebsd> or any other OS supported by p2. Since + *
        • rootFolders - OS-specific installation root folders, overriding + * rootFolder. Allowed children are <macosx>, <win32>, + * <linux> and <freebsd> or any other OS supported by p2. Since * 0.18.0
        • *
        * diff --git a/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java index c37d3c3c10..9a6d98014a 100644 --- a/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java +++ b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/DirectorMojo.java @@ -218,7 +218,7 @@ public class DirectorMojo extends AbstractMojo { /** * A list of properties in the form key=value pairs. Effective only when a new profile is - * created. For example org.eclipse.update.install.features=true to install the + * created. For example org.eclipse.update.install.features=true to install the * features into the product. */ @Parameter(property = "profileproperties") @@ -227,6 +227,9 @@ public class DirectorMojo extends AbstractMojo { @Parameter(property = "installFeatures", defaultValue = "true") private boolean installFeatures; + @Parameter(defaultValue = "false") + private boolean installSources; + /** * Additional profile properties to set when materializing the product */ @@ -473,6 +476,9 @@ private Map getPropertyMap(String csvPropertiesMap, Maporg.eclipse.update.install.features to true in the p2 profile.) + * org.eclipse.update.install.features to true in the p2 profile.) */ @Parameter(defaultValue = "true") private boolean installFeatures; + /** + * Include the sources of JARs in installation. (Technically, this sets the property + * org.eclipse.update.install.sources to true in the p2 profile.) + */ + @Parameter(defaultValue = "false") + private boolean installSources; + /** * Additional profile properties to set when materializing the product */ @@ -93,7 +100,7 @@ public enum DirectorRuntimeType { * Source repositories to be used in the director calls. Can be: *
          *
        • targetPlatform - to use the target platform as source (default)
        • - *
        • repository - to use the p2 repository in target/repository/ as + *
        • repository - to use the p2 repository in target/repository/ as * source. With this option, the build implicitly verifies that it would also be possible to * install the product from that repository with an external director application. *
        @@ -201,9 +208,10 @@ private void buildProduct(DirectorRuntime director, RepositoryReferences sources command.setProfileName(ProfileName.getNameForEnvironment(env, profileNames, profile)); command.setEnvironment(env); command.setInstallFeatures(installFeatures); + command.setInstallSources(installSources); command.setProfileProperties(profileProperties); getLog().info("Installing product " + product.getId() + " for environment " + env + " to " - + destination.getAbsolutePath()); + + destination.getAbsolutePath() + " using " + command.getProfileProperties()); try { command.execute(); } catch (DirectorCommandException e) { diff --git a/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/Product.java b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/Product.java index 310bab1286..fe38ae07c2 100644 --- a/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/Product.java +++ b/tycho-p2-director-plugin/src/main/java/org/eclipse/tycho/plugins/p2/director/Product.java @@ -46,7 +46,7 @@ public final class Product { private String rootFolder; /** - * OS-specific name of the root folder of the materialized product using osgi.os + * OS-specific name of the root folder of the materialized product using osgi.os * environment values as keys. Has precedence over rootFolder. */ private Map rootFolders; diff --git a/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineValidator.java b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineValidator.java index 6cfff835d9..606be054f8 100644 --- a/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineValidator.java +++ b/tycho-p2-plugin/src/main/java/org/eclipse/tycho/plugins/p2/BaselineValidator.java @@ -192,7 +192,7 @@ public Map validateAndReplace(MavenProject project, Compari } } } else { - log.info("No baseline version " + project); + log.info("No baseline version " + project.getId()); } } return result; diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java index 49e789252f..aadbc04644 100644 --- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java +++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishCategoriesMojo.java @@ -39,7 +39,7 @@ /** *

        - * Publishes the category definitions from the category.xml in the root of the project. + * Publishes the category definitions from the category.xml in the root of the project. *

        * * @see https://wiki.eclipse.org/Equinox/p2/Publisher diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java index 62853a963f..a031d19d1a 100644 --- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java +++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java @@ -67,7 +67,7 @@ /** *

        - * Publishes all product definitions files (*.product) that are present in the root of the + * Publishes all product definitions files (*.product) that are present in the root of the * project. *

        * diff --git a/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AssembleRepositoryMojo.java b/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AssembleRepositoryMojo.java index 4ee03e7dc5..4f3471875c 100644 --- a/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AssembleRepositoryMojo.java +++ b/tycho-p2-repository-plugin/src/main/java/org/eclipse/tycho/plugins/p2/repository/AssembleRepositoryMojo.java @@ -167,7 +167,7 @@ public static class RepositoryReferenceFilter { /** *

        - * Compress the repository index files content.xml and artifacts.xml. + * Compress the repository index files content.xml and artifacts.xml. *

        */ @Parameter(defaultValue = "true") diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageFeatureMojo.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageFeatureMojo.java index 8af5d29cc3..3594c8da9c 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageFeatureMojo.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackageFeatureMojo.java @@ -80,7 +80,7 @@ public class PackageFeatureMojo extends AbstractTychoPackagingMojo { /** * The output directory of the jar file * - * By default this is the Maven target/ directory. + * By default this is the Maven target/ directory. */ @Parameter(property = "project.build.directory") private File outputDirectory; @@ -256,8 +256,8 @@ private void appendToOrAddFeatureProperties(File targetFeatureProperties, File l } /** - * @return A {@link FileSet} including files as configured by the bin.includes and - * bin.excludes properties without the files that are always included + * @return A {@link FileSet} including files as configured by the bin.includes and + * bin.excludes properties without the files that are always included * automatically. */ private FileSet getManuallyIncludedFiles(BuildProperties buildProperties) { diff --git a/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/OsgiSourceMojo.java b/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/OsgiSourceMojo.java index 3d8bc644ef..257e3cffb4 100644 --- a/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/OsgiSourceMojo.java +++ b/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/OsgiSourceMojo.java @@ -137,8 +137,8 @@ public class OsgiSourceMojo extends AbstractSourceJarMojo { /** * Additional files to be included in the source bundle jar. This can be used when - * src.includes in build.properties is not flexible enough , e.g. for files which would - * otherwise conflict with files in bin.includes
        + * src.includes in build.properties is not flexible enough , e.g. for files which would + * otherwise conflict with files in bin.includes
        * Example:
        * *
        diff --git a/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/SourceFeatureMojo.java b/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/SourceFeatureMojo.java
        index 35803c454f..e9695eef62 100644
        --- a/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/SourceFeatureMojo.java
        +++ b/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/SourceFeatureMojo.java
        @@ -639,8 +639,8 @@ private String getAttribute(PlexusConfiguration dom, String attrName) {
             }
         
             /**
        -     * @return A {@link FileSet} including files as configured by the src.includes and
        -     *         src.excludes properties without the files that are always included
        +     * @return A {@link FileSet} including files as configured by the src.includes and
        +     *         src.excludes properties without the files that are always included
              *         automatically.
              */
             private FileSet getManuallyIncludedFiles(File basedir, BuildProperties buildProperties) {
        diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java
        index 5e880ad396..092ee9d7a4 100644
        --- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java
        +++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/AbstractEclipseTestMojo.java
        @@ -429,7 +429,7 @@ public abstract class AbstractEclipseTestMojo extends AbstractTestMojo {
              * when installing products under test (see below).
              * 
          *
        • In default mode, all necessary files to define the test runtime like - * config.ini are generated by tycho. This installation mode has the advantage that the + * config.ini are generated by tycho. This installation mode has the advantage that the * test runtime is minimal (defined by the transitive dependencies of the test bundle plus and * the test harness) and existing bundle jars are referenced rather than copied for the * installation
        • @@ -480,8 +480,8 @@ public abstract class AbstractEclipseTestMojo extends AbstractTestMojo { * Additional dependencies to be added to the test runtime. * * Note: This parameter has only limited support for dependencies to artifacts within the - * reactor. Therefore it is recommended to specify extraRequirements on the - * target-platform-configuration plugin instead. Example: + * reactor. Therefore it is recommended to specify extraRequirements on the + * target-platform-configuration plugin instead. Example: * *
                * <plugin>
          @@ -502,8 +502,8 @@ public abstract class AbstractEclipseTestMojo extends AbstractTestMojo {
                * </plugin>
                * 
          * - * The dependencies specified as extraRequirements are – together with the - * dependencies specified in the MANIFEST.MF of the project – transitively + * The dependencies specified as extraRequirements are – together with the + * dependencies specified in the MANIFEST.MF of the project – transitively * resolved against the target platform. The resulting set of bundles is included in the test * runtime. */ diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestPluginMojo.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestPluginMojo.java index bc8259f8ff..336702e3db 100644 --- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestPluginMojo.java +++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestPluginMojo.java @@ -35,9 +35,9 @@ * runtime" consists of the bundle built in this project and its transitive dependencies, plus some * Equinox and test harness bundles. The bundles are resolved from the target platform of the * project. Note that the test runtime does typically not contain the entire target - * platform. If there are implicitly required bundles (e.g. org.apache.felix.scr to make - * declarative services work), they need to be added manually through an extraRequirements - * configuration on the target-platform-configuration plugin. + * platform. If there are implicitly required bundles (e.g. org.apache.felix.scr to make + * declarative services work), they need to be added manually through an extraRequirements + * configuration on the target-platform-configuration plugin. *

          */ @Mojo(name = "test", defaultPhase = LifecyclePhase.INTEGRATION_TEST, requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true) diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TychoIntegrationTestMojo.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TychoIntegrationTestMojo.java index bf4ddaa215..9b8796219b 100644 --- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TychoIntegrationTestMojo.java +++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TychoIntegrationTestMojo.java @@ -49,9 +49,9 @@ * the bundle built in this project and its transitive dependencies, plus some Equinox and test * harness bundles. The bundles are resolved from the target platform of the project. Note that the * test runtime does typically not contain the entire target platform. If there are - * implicitly required bundles (e.g. org.apache.felix.scr to make declarative services - * work), they need to be added manually through an extraRequirements configuration on the - * target-platform-configuration plugin. + * implicitly required bundles (e.g. org.apache.felix.scr to make declarative services + * work), they need to be added manually through an extraRequirements configuration on the + * target-platform-configuration plugin. *

          *

          * This goal adopts the maven-failsafe paradigm, that works in the following way: diff --git a/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinition.java b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinition.java index e700d90ce2..1a0683df41 100644 --- a/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinition.java +++ b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetDefinition.java @@ -34,7 +34,7 @@ public interface TargetDefinition { /** * Returns true if the target definition specifies an explicit list - * of bundles to include (i.e. an <includeBundles> in target + * of bundles to include (i.e. an <includeBundles> in target * definition files). */ boolean hasIncludedBundles(); diff --git a/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetPlatformFilter.java b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetPlatformFilter.java index 9ccb1c2918..9c020ba6c9 100644 --- a/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetPlatformFilter.java +++ b/tycho-targetplatform/src/main/java/org/eclipse/tycho/targetplatform/TargetPlatformFilter.java @@ -58,8 +58,8 @@ public FilterAction getAction() { *

          * If the action pattern returns null for its type, or type and id attributes, * these values shall be inherited from the scope pattern. This ensures that filters with a - * short <restrictTo> pattern with only a single <version> or - * <versionRange> attribute work as expected. + * short <restrictTo> pattern with only a single <version> or + * <versionRange> attribute work as expected. *

          */ public CapabilityPattern getActionPattern() { diff --git a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/EnvironmentUtil.java b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/EnvironmentUtil.java index 4190114d06..4c09d8edeb 100644 --- a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/EnvironmentUtil.java +++ b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/EnvironmentUtil.java @@ -30,7 +30,7 @@ /** * Provides system properties and certain properties from the test code build ("outer build"), like * the location of the local Maven repository. For this class to work, the outer build must - * configure the maven-properties-plugin to capture the values in a file called + * configure the maven-properties-plugin to capture the values in a file called * baseTest.properties (see tycho-its/pom.xml for an example). */ public class EnvironmentUtil { diff --git a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/P2RepositoryTool.java b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/P2RepositoryTool.java index b3151eec01..5369ac8697 100644 --- a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/P2RepositoryTool.java +++ b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/util/P2RepositoryTool.java @@ -158,7 +158,7 @@ public List getUnitVersions(String unitId) throws Exception { * Returns the unique IU with the given ID. * * @throws AssertionError - * unless there is exactly one IU with the given unitId. + * unless there is exactly one IU with the given unitId. */ public IU getUniqueIU(String unitId) throws Exception { loadMetadata(); diff --git a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/SetVersionMojo.java b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/SetVersionMojo.java index 1a459965ea..9a15da6ff7 100644 --- a/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/SetVersionMojo.java +++ b/tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/SetVersionMojo.java @@ -41,17 +41,17 @@ *
            *
          • When the parent project of a project is changed and the project has the same version as the * parent project, the project is also changed.
          • - *
          • When an eclipse-plugin project is changed and the plugin exports a package with a + *
          • When an eclipse-plugin project is changed and the plugin exports a package with a * version which is the same as the unqualified project version, the version of the package is also * changed. - *
          • Require-Bundle and Fragment-Host Version Range in references to an eclipse-plugin + *
          • Require-Bundle and Fragment-Host Version Range in references to an eclipse-plugin * that changed version will be updated: *
              *
            • if the newVersion becomes out of the original VersionRange *
            • or if {@link #updateVersionRangeMatchingBounds} is true and one of the bounds is matching the * original version *
            - *
          • When an eclipse-repository project is changed and a product file in the project has + *
          • When an eclipse-repository project is changed and a product file in the project has * an equivalent version, the version in the product file is also changed.
          • *
          *