Skip to content

Commit

Permalink
Use plexus annotations rather than doclet to fix javadoc with java11 (#…
Browse files Browse the repository at this point in the history
…90)

* test javadoc as part of the build

Signed-off-by: olivier lamy <olamy@apache.org>

* fix javadoc by using annotations rather than doclet format code

Signed-off-by: olivier lamy <olamy@apache.org>

* project still java7

Signed-off-by: olivier lamy <olamy@apache.org>

* java 8 needed

Signed-off-by: olivier lamy <olamy@apache.org>
  • Loading branch information
olamy authored Aug 14, 2020
1 parent 27222bf commit 3300ad4
Show file tree
Hide file tree
Showing 23 changed files with 636 additions and 440 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
java-version: ${{ matrix.java }}

- name: Build with Maven
run: mvn install -e -B -V -Pno-tests-if-not-on-osx
run: mvn install javadoc:javadoc -e -B -V -Pno-tests-if-not-on-osx
4 changes: 4 additions & 0 deletions plexus-compiler-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@
*/

import org.codehaus.plexus.compiler.Compiler;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.AbstractLogEnabled;

import java.util.Map;

/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
* @plexus.component
*/
@Component( role = CompilerManager.class )
public class DefaultCompilerManager
extends AbstractLogEnabled
implements CompilerManager
{
/**
* @plexus.requirement role="org.codehaus.plexus.compiler.Compiler"
*/
@Requirement
private Map<String, Compiler> compilers;

// ----------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions plexus-compilers/plexus-compiler-aspectj/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
</properties>

<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.tools.ajc.Main;
import org.codehaus.plexus.compiler.AbstractCompiler;
import org.codehaus.plexus.compiler.Compiler;
import org.codehaus.plexus.compiler.CompilerConfiguration;
import org.codehaus.plexus.compiler.CompilerException;
import org.codehaus.plexus.compiler.CompilerMessage;
import org.codehaus.plexus.compiler.CompilerOutputStyle;
import org.codehaus.plexus.compiler.CompilerResult;
import org.codehaus.plexus.component.annotations.Component;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -281,8 +283,8 @@
* </p>
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @plexus.component role="org.codehaus.plexus.compiler.Compiler" role-hint="aspectj"
*/
@Component( role = Compiler.class, hint = "aspectj")
public class AspectJCompiler
extends AbstractCompiler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ public class AspectJCompilerConfiguration
extends CompilerConfiguration
{

private List<String> aspectPath = new LinkedList<String>();
private List<String> aspectPath = new LinkedList<>();

private List<String> inJars = new LinkedList<String>();
private List<String> inJars = new LinkedList<>();

private List<String> inPath = new LinkedList<String>();
private List<String> inPath = new LinkedList<>();

private String outputJar;

private Map<String, String> ajOptions = new TreeMap<String, String>();
private Map<String, String> ajOptions = new TreeMap<>();

private Map<String, File> sourcePathResources;

public void setAspectPath( List<String> aspectPath )
{
this.aspectPath = new LinkedList<String>( aspectPath );
this.aspectPath = new LinkedList<>( aspectPath );
}

public void addAspectPath( String aspectPath )
Expand All @@ -46,7 +46,7 @@ public List<String> getAspectPath()

public void setInJars( List<String> inJars )
{
this.inJars = new LinkedList<String>( inJars );
this.inJars = new LinkedList<>( inJars );
}

public void addInJar( String inJar )
Expand All @@ -61,7 +61,7 @@ public List<String> getInJars()

public void setInPath( List<String> inPath )
{
this.inPath = new LinkedList<String>( inPath );
this.inPath = new LinkedList<>( inPath );
}

public void addInPath( String inPath )
Expand All @@ -86,7 +86,6 @@ public String getOutputJar()

/**
* Ignored, not supported yet
* @param ajOptions
*/
public void setAJOptions( Map<String, String> ajOptions )
{
Expand Down Expand Up @@ -118,4 +117,4 @@ public Map<String, File> getSourcePathResources()
return sourcePathResources;
}

}
}
4 changes: 4 additions & 0 deletions plexus-compilers/plexus-compiler-csharp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<description>C# Compiler support for Plexus Compiler component.</description>

<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.codehaus.plexus.compiler.CompilerMessage;
import org.codehaus.plexus.compiler.CompilerOutputStyle;
import org.codehaus.plexus.compiler.CompilerResult;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.Os;
Expand Down Expand Up @@ -54,9 +55,8 @@
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
* @author <a href="mailto:matthew.pocock@ncl.ac.uk">Matthew Pocock</a>
* @author <a href="mailto:chris.stevenson@gmail.com">Chris Stevenson</a>
* @plexus.component role="org.codehaus.plexus.compiler.Compiler"
* role-hint="csharp"
*/
@Component( role = Compiler.class, hint = "csharp" )
public class CSharpCompiler
extends AbstractCompiler
{
Expand Down Expand Up @@ -242,7 +242,7 @@ private String findExecutable( CompilerConfiguration config )
private String[] buildCompilerArguments( CompilerConfiguration config, String[] sourceFiles )
throws CompilerException
{
List<String> args = new ArrayList<String>();
List<String> args = new ArrayList<>();

if ( config.isDebug() )
{
Expand Down Expand Up @@ -358,7 +358,7 @@ private String[] buildCompilerArguments( CompilerConfiguration config, String[]

if ( !StringUtils.isEmpty( resourcefile ) )
{
String resourceTarget = (String) compilerArguments.get( "-resourcetarget" );
String resourceTarget = compilerArguments.get( "-resourcetarget" );
args.add( "/res:" + new File( resourcefile ).getAbsolutePath() + "," + resourceTarget );
}

Expand Down Expand Up @@ -439,7 +439,7 @@ private File findResourceDir( CompilerConfiguration config )

Map<String, String> compilerArguments = getCompilerArguments( config );

String tempResourcesDirAsString = (String) compilerArguments.get( "-resourceDir" );
String tempResourcesDirAsString = compilerArguments.get( "-resourceDir" );
File filteredResourceDir = null;
if ( tempResourcesDirAsString != null )
{
Expand Down Expand Up @@ -548,7 +548,7 @@ private List<CompilerMessage> compileOutOfProcess( File workingDirectory, File t
public static List<CompilerMessage> parseCompilerOutput( BufferedReader bufferedReader )
throws IOException
{
List<CompilerMessage> messages = new ArrayList<CompilerMessage>();
List<CompilerMessage> messages = new ArrayList<>();

String line = bufferedReader.readLine();

Expand Down Expand Up @@ -582,7 +582,7 @@ private String getType( Map<String, String> compilerArguments )
private String getTypeExtension( CompilerConfiguration configuration )
throws CompilerException
{
String type = getType( configuration.getCustomCompilerArguments() );
String type = getType( configuration.getCustomCompilerArgumentsAsMap() );

if ( "exe".equals( type ) || "winexe".equals( type ) )
{
Expand All @@ -600,7 +600,7 @@ private String getTypeExtension( CompilerConfiguration configuration )
// added for debug purposes....
protected static String[] getSourceFiles( CompilerConfiguration config )
{
Set<String> sources = new HashSet<String>();
Set<String> sources = new HashSet<>();

//Set sourceFiles = null;
//was:
Expand Down Expand Up @@ -637,7 +637,7 @@ protected static String[] getSourceFiles( CompilerConfiguration config )
}
else
{
result = (String[]) sources.toArray( new String[sources.size()] );
result = sources.toArray( new String[sources.size()] );
}

return result;
Expand Down Expand Up @@ -685,7 +685,7 @@ protected static Set<String> getSourceFilesForSourceRoot( CompilerConfiguration

String[] sourceDirectorySources = scanner.getIncludedFiles();

Set<String> sources = new HashSet<String>();
Set<String> sources = new HashSet<>();

for ( String source : sourceDirectorySources )
{
Expand Down
4 changes: 4 additions & 0 deletions plexus-compilers/plexus-compiler-eclipse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<artifactId>ecj</artifactId>
<version>3.22.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
* @author <a href="mailto:jal@etc.to">Frits Jalvingh</a>
* Created on 22-4-18.
*/
public class EcjFailureException extends RuntimeException {
public class EcjFailureException
extends RuntimeException
{
private final String ecjOutput;

public EcjFailureException(String ecjOutput) {
super("Failed to run the ecj compiler: " + ecjOutput);
public EcjFailureException( String ecjOutput )
{
super( "Failed to run the ecj compiler: " + ecjOutput );
this.ecjOutput = ecjOutput;
}

Expand Down
Loading

0 comments on commit 3300ad4

Please sign in to comment.