Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build warnings and revert compiler workaround #3813

Merged
merged 5 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions demo/osgi-repository/my-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</parent>
<artifactId>my-bundle</artifactId>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
Expand Down
24 changes: 22 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,6 @@
<configuration>
<source>${min.jdk.version}</source>
<target>${min.jdk.version}</target>
<!-- Workaround for https://issues.apache.org/jira/browse/MCOMPILER-567 -->
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -635,6 +633,28 @@
</plugins>
</build>
</profile>
<profile>
<!-- allow annotation processing on JDK 21+ -->
<id>avoid-maven-compiler-warnings</id>
<activation>
<jdk>[21,)</jdk>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- avoid annotation processor warning on JDK 21+.
The flag must be set explicitly there. -->
<proc>full</proc>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
<distributionManagement>
<site>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* TODO: At least one step could be optimized, currently the plugin will do two scans of all the
* source code if the compiler has to have the entire set of sources. This is currently the case for
* at least the C# compiler and most likely all the other .NET compilers too.
*
*
* @author others
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
* @author Jan Sievers (SAP) added support for annotation processor options
Expand Down Expand Up @@ -124,9 +124,10 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {

/**
* The -encoding argument for the Java compiler (kept for backwards compatibility)
*
*
* @deprecated use {@link #encoding}
*/
@Deprecated
@Parameter(property = "maven.compiler.encoding", readonly = true)
private String mavenCompilerEncoding;

Expand Down Expand Up @@ -183,13 +184,13 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
private String executable;

/**
* If <code>only</code> is specified, the annotation processors will run but no compilation will be
* performed. If <code>none</code> 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 <code>none</code> 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
*
* If <code>only</code> is specified, the annotation processors will run but no compilation will
* be performed. If <code>none</code> 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 <code>none</code>
* 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
*
* @since 0.16.0
*/
@Parameter
Expand All @@ -200,7 +201,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
* <a href="https://java.sun.com/javase/6/docs/api/javax/annotation/processing/Processor.html" >
* normal processor discovery process</a> will be skipped. This parameter requires a 1.6 VM or
* above and is used only if the compliance is 1.6
*
*
* @since 0.16.0
*/
@Parameter
Expand All @@ -209,7 +210,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
/**
* The directory where source files generated by annotation processors will be created. This
* parameter requires a 1.6 VM or above and is used only if the compliance is 1.6.
*
*
* @since 0.16.0
*/
@Parameter(defaultValue = "${project.build.directory}/generated-sources/annotations")
Expand All @@ -223,15 +224,16 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
* This is because the list of valid arguments passed to a Java compiler varies based on the
* compiler version.
* </p>
*
*
* @deprecated use {@link #compilerArgs} instead.
*/
@Deprecated
@Parameter
private Map<String, String> compilerArguments;

/**
* Arguments to be passed to the compiler.
*
*
* @since 0.17.0
*/
@Parameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public class MirrorMojo extends AbstractMojo {

/**
* Source repositori(es) to mirror from.
*
* @see {@link #targetPlatformAsSource} and {@link #currentModuleAsSource}
*
* See also {@link #targetPlatformAsSource} and {@link #currentModuleAsSource}
*/
@Parameter(required = false)
private List<Repository> source;
Expand Down Expand Up @@ -166,7 +166,7 @@ public class MirrorMojo extends AbstractMojo {
* Add XZ-compressed repository index files. XZ offers better compression ratios esp. for highly
* redundant file content.
* </p>
*
*
* @since 0.25.0
*/
@Parameter(defaultValue = "true")
Expand All @@ -178,7 +178,7 @@ public class MirrorMojo extends AbstractMojo {
* addition to XZ-compressed index files. This fallback provides backwards compatibility for
* pre-Mars p2 clients which cannot read XZ-compressed index files.
* </p>
*
*
* @since 0.25.0
*/
@Parameter(defaultValue = "true")
Expand All @@ -189,7 +189,7 @@ public class MirrorMojo extends AbstractMojo {
* Whether to add the target-platform content as a source. Ignored for non-Tycho packaging
* types.
* </p>
*
*
* @since 1.1.0
*/
@Parameter(defaultValue = "false")
Expand All @@ -200,7 +200,7 @@ public class MirrorMojo extends AbstractMojo {
* Whether the current build p2 output should be added as source. Ignored for non-Tycho
* packaging types. Ignored if {@link #targetPlatformAsSource} == false;
* </p>
*
*
* @since 1.1.0
*/
@Parameter(defaultValue = "true")
Expand All @@ -211,7 +211,7 @@ public class MirrorMojo extends AbstractMojo {
* If set to true, mirroring continues to run in the event of an error during the mirroring
* process and will just log an info message.
* </p>
*
*
* @since 1.1.0
*/
@Parameter(defaultValue = "false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

/**
* This goal invokes the feature and bundle publisher on a folder.
*
* @see https://wiki.eclipse.org/Equinox/p2/Publisher#Features_And_Bundles_Publisher_Application
*
* @see <a href="https://wiki.eclipse.org/Equinox/p2/Publisher#Features_And_Bundles_Publisher_Application">Eclipse Wiki</a>
*/
@Mojo(name = "publish-features-and-bundles", threadSafe = true)
public class PublishFeaturesAndBundlesMojo extends AbstractMojo {
Expand All @@ -49,7 +49,7 @@ public class PublishFeaturesAndBundlesMojo extends AbstractMojo {
* Location of the artifact repository to write. Note: The AssembleRepositoryMojo of
* tycho-p2-repository-plugin will only work with the predefined default
* ${project.build.directory}/repository.
*
*
*/
@Parameter(defaultValue = "${project.build.directory}/repository")
private String artifactRepositoryLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.tycho.tychoits.TYCHO590</groupId>
<artifactId>annotated-project</artifactId>

<parent>
<groupId>org.eclipse.tycho.tychoits.TYCHO590</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>8</source>
<target>8</target>
<fork>false</fork>
<compilerId>jdt</compilerId>
<annotationProcessors>
Expand Down
6 changes: 3 additions & 3 deletions tycho-its/projects/TYCHO590annotationProcessing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>annotation-processor</module>
<module>annotated-project</module>
Expand All @@ -18,8 +18,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>8</source>
<target>8</target>
<fork>false</fork>
<compilerId>jdt</compilerId>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
</properties>

<dependencies>
<!-- Adding another dependency just to verify that also transitive dependencies
<!-- Adding another dependency just to verify that also transitive dependencies
get resolved and added to the javadoc execution class path -->
<dependency>
<groupId>org.eclipse.tycho</groupId>
Expand Down
2 changes: 1 addition & 1 deletion tycho-lib-detector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<configuration combine.self="override">
<!-- make sure we use minimum source/target level as this code will be run in old JVMs -->
<source>1.3</source>
<target>1.1</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* Publishes the category definitions from the <code>category.xml</code> in the root of the project.
* </p>
*
* @see https://wiki.eclipse.org/Equinox/p2/Publisher
* @see <a href="https://wiki.eclipse.org/Equinox/p2/Publisher">Eclipse Wiki</a>
*/
@Mojo(name = "publish-categories", defaultPhase = LifecyclePhase.PACKAGE, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME)
public final class PublishCategoriesMojo extends AbstractPublishMojo {
Expand Down Expand Up @@ -80,7 +80,7 @@ protected Collection<DependencySeed> publishContent(PublisherServiceFactory publ

/**
* Writes the Tycho-internal representation of categories back to a category.xml.
*
*
* @param category
* a category, with "qualifier" literals already replaced by the build qualifier.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
* Publishes all product definitions files (<code>*.product</code>) that are present in the root of
* the project.
* </p>
*
* @see https://wiki.eclipse.org/Equinox/p2/Publisher
*
* @see <a href="https://wiki.eclipse.org/Equinox/p2/Publisher">Eclipse Wiki</a>
*/
@Mojo(name = "publish-products", defaultPhase = LifecyclePhase.PACKAGE, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME)
public final class PublishProductMojo extends AbstractPublishMojo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</parent>
<artifactId>org.eclipse.tycho.bnd.executionlistener</artifactId>
<properties>
<min.jdk.version>1.8</min.jdk.version>
<min.jdk.version>8</min.jdk.version>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<packaging>jar</packaging>
<name>Tycho Surefire OSGi Booter Eclipse Application</name>
<properties>
<java.version>1.8</java.version>
<java.version>8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
Expand Down