Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
slachiewicz committed May 27, 2023
1 parent 9e10821 commit 346da1b
Show file tree
Hide file tree
Showing 407 changed files with 8,721 additions and 12,259 deletions.
7 changes: 2 additions & 5 deletions plexus-component-annotations/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand All @@ -12,8 +11,6 @@
<artifactId>plexus-component-annotations</artifactId>

<name>Plexus :: Component Annotations (deprecated)</name>
<description>
Plexus Component "Java 5" Annotations, to describe plexus components properties in java sources with
standard annotations instead of javadoc annotations.
</description>
<description>Plexus Component "Java 5" Annotations, to describe plexus components properties in java sources with
standard annotations instead of javadoc annotations.</description>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
package org.codehaus.plexus.component.annotations;

import java.lang.annotation.Documented;
import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Marks a class as a Plexus component.
*
Expand All @@ -34,8 +35,7 @@
@Target(TYPE)
@Inherited
@Deprecated
public @interface Component
{
public @interface Component {
Class<?> role();

String hint() default "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
package org.codehaus.plexus.component.annotations;

import java.lang.annotation.Documented;
import static java.lang.annotation.ElementType.FIELD;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Marks a field as a configuration element with a default value.
*
Expand All @@ -34,8 +35,7 @@
@Target(FIELD)
@Inherited
@Deprecated
public @interface Configuration
{
public @interface Configuration {
String name() default "";

String value();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
package org.codehaus.plexus.component.annotations;

import java.lang.annotation.Documented;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Configures a requirement.
*
Expand All @@ -32,11 +33,10 @@
*/
@Documented
@Retention(RUNTIME)
@Target({ FIELD, METHOD })
@Target({FIELD, METHOD})
@Inherited
@Deprecated
public @interface Requirement
{
public @interface Requirement {
Class<?> role() default Object.class;

String hint() default "";
Expand All @@ -48,5 +48,4 @@
String[] hints() default {};

boolean optional() default false;

}
9 changes: 4 additions & 5 deletions plexus-component-metadata/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
<!-- $Id$ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -57,7 +57,7 @@
<artifactId>asm</artifactId>
<version>9.5</version>
</dependency>

<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
Expand Down Expand Up @@ -95,7 +95,7 @@
<additionalparam>-Xdoclint:none</additionalparam>
<failOnError>false</failOnError>
</configuration>
</plugin>
</plugin>
</plugins>
</reporting>

Expand Down Expand Up @@ -135,6 +135,5 @@
</build>
</profile>
</profiles>



</project>
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
package org.codehaus.plexus.maven.plugin;

import java.util.List;

/*
* The MIT License
*
*
* Copyright (c) 2004-2006, The Codehaus
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import java.util.List;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
Expand All @@ -35,20 +35,18 @@
*
* @author Jason van Zyl
*/
public abstract class AbstractDescriptorMojo
extends AbstractMojo
{
public abstract class AbstractDescriptorMojo extends AbstractMojo {

/**
* Current project
*/
@Parameter( defaultValue = "${project}", required = true, readonly = true )
@Parameter(defaultValue = "${project}", required = true, readonly = true)
protected MavenProject mavenProject;

/**
* The file encoding of the source files.
*/
@Parameter( defaultValue = "${project.build.sourceEncoding}" )
@Parameter(defaultValue = "${project.build.sourceEncoding}")
protected String sourceEncoding;

/**
Expand All @@ -61,7 +59,7 @@ public abstract class AbstractDescriptorMojo
*/
@Parameter
protected List<String> extractors;

@Component
protected MavenProjectHelper mavenProjectHelper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

/*
* Copyright (c) 2004-2005, Codehaus.org
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
Expand All @@ -31,55 +31,51 @@
/**
* Generates a Plexus {@code components.xml} component descriptor file from source (javadoc) or
* class annotations and manually crafted descriptor files.
*
*
* @author Jason van Zyl
* @author Trygve Laugst&oslash;l
*/
@Mojo( name = "generate-metadata", defaultPhase = LifecyclePhase.PROCESS_CLASSES, requiresDependencyResolution = ResolutionScope.COMPILE )
public class PlexusDescriptorMojo
extends AbstractDescriptorMojo
{
@Mojo(
name = "generate-metadata",
defaultPhase = LifecyclePhase.PROCESS_CLASSES,
requiresDependencyResolution = ResolutionScope.COMPILE)
public class PlexusDescriptorMojo extends AbstractDescriptorMojo {
/**
* The output location for the generated descriptor.
*/
@Parameter( defaultValue = "${project.build.outputDirectory}/META-INF/plexus/components.xml", required = true )
@Parameter(defaultValue = "${project.build.outputDirectory}/META-INF/plexus/components.xml", required = true)
protected File generatedMetadata;

/**
* The location of manually crafted component descriptors. The contents of the descriptor files in this directory is
* merged with the information extracted from the project's sources/classes.
*/
@Parameter( defaultValue = "${basedir}/src/main/resources/META-INF/plexus", required = true )
@Parameter(defaultValue = "${basedir}/src/main/resources/META-INF/plexus", required = true)
protected File staticMetadataDirectory;

/**
* The output location for the intermediary descriptor. This descriptors contains only the information extracted
* from the project's sources/classes.
*/
@Parameter( defaultValue = "${project.build.directory}/components.xml", required = true )
@Parameter(defaultValue = "${project.build.directory}/components.xml", required = true)
protected File intermediaryMetadata;

public void execute()
throws MojoExecutionException
{
public void execute() throws MojoExecutionException {
MetadataGenerationRequest request = new MetadataGenerationRequest();

try
{
try {
request.classpath = mavenProject.getCompileClasspathElements();
request.classesDirectory = new File( mavenProject.getBuild().getOutputDirectory() );
request.classesDirectory = new File(mavenProject.getBuild().getOutputDirectory());
request.sourceDirectories = mavenProject.getCompileSourceRoots();
request.sourceEncoding = sourceEncoding;
request.componentDescriptorDirectory = staticMetadataDirectory;
request.intermediaryFile = intermediaryMetadata;
request.outputFile = generatedMetadata;
request.extractors = extractors;

metadataGenerator.generateDescriptor( request );
}
catch ( Exception e )
{
throw new MojoExecutionException( "Error generating metadata: ", e );

metadataGenerator.generateDescriptor(request);
} catch (Exception e) {
throw new MojoExecutionException("Error generating metadata: ", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

/*
* Copyright (c) 2004-2006, Codehaus.org
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
Expand All @@ -35,18 +35,16 @@

/**
* Merges a set of Plexus descriptors into one descriptor file.
*
*
* @author Jason van Zyl
* @author Trygve Laugst&oslash;l
*/
@Mojo( name = "merge-metadata", defaultPhase = LifecyclePhase.PROCESS_CLASSES )
public class PlexusMergeMojo
extends AbstractMojo
{
@Mojo(name = "merge-metadata", defaultPhase = LifecyclePhase.PROCESS_CLASSES)
public class PlexusMergeMojo extends AbstractMojo {
/**
* The destination for the merged descriptor.
*/
@Parameter( defaultValue = "${project.build.outputDirectory}/META-INF/plexus/components.xml", required = true )
@Parameter(defaultValue = "${project.build.outputDirectory}/META-INF/plexus/components.xml", required = true)
private File output;

/**
Expand All @@ -55,31 +53,24 @@ public class PlexusMergeMojo
@Parameter
private File[] descriptors;

@Component( hint = "componentsXml" )
@Component(hint = "componentsXml")
private Merger merger;

public void execute()
throws MojoExecutionException
{
public void execute() throws MojoExecutionException {
List<File> files = new ArrayList<File>();

if ( descriptors != null )
{
files.addAll( Arrays.asList( descriptors ) );
if (descriptors != null) {
files.addAll(Arrays.asList(descriptors));
}

if ( files.isEmpty() )
{
if (files.isEmpty()) {
return;
}

try
{
merger.mergeDescriptors( output, files );
}
catch ( IOException e )
{
throw new MojoExecutionException( "Error while executing component descriptor creator.", e );
try {
merger.mergeDescriptors(output, files);
} catch (IOException e) {
throw new MojoExecutionException("Error while executing component descriptor creator.", e);
}
}
}
Loading

0 comments on commit 346da1b

Please sign in to comment.