Skip to content

Commit

Permalink
Enable checkstyle verification during build
Browse files Browse the repository at this point in the history
- enable checkstyle plugin
- reformat code to meet checkstyle requirements
- reorder imports
  • Loading branch information
slawekjaranowski committed Aug 15, 2022
1 parent 45b7162 commit 592c8cd
Show file tree
Hide file tree
Showing 13 changed files with 1,690 additions and 1,430 deletions.
9 changes: 9 additions & 0 deletions pom.xml
Expand Up @@ -210,6 +210,15 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/codehaus/mojo/flatten/CleanMojo.java
Expand Up @@ -34,9 +34,8 @@
* @author Joerg Hohwiller (hohwille at users.sourceforge.net)
* @since 1.0.0-beta-2
*/
//CHECKSTYLE_OFF: LineLength
@Mojo( name = "clean", requiresProject = true, requiresDirectInvocation = false, executionStrategy = "once-per-session", threadSafe = true )
//CHECKSTYLE_ON: LineLength
@Mojo( name = "clean", requiresProject = true, requiresDirectInvocation = false, executionStrategy = "once-per-session",
threadSafe = true )
public class CleanMojo
extends AbstractFlattenMojo
{
Expand Down
384 changes: 222 additions & 162 deletions src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java

Large diffs are not rendered by default.

442 changes: 223 additions & 219 deletions src/main/java/org/codehaus/mojo/flatten/KeepCommentsInPom.java

Large diffs are not rendered by default.

Expand Up @@ -46,11 +46,14 @@
import org.eclipse.sisu.Nullable;

/**
* Works around thread safety issues when modifying the global singleton {@link org.apache.maven.model.building.DefaultModelBuilder DefaultModelBuilder}
* with custom {@link ProfileInjector} and {@link ProfileSelector}. Instead of modifying the global {@code DefaultModelBuilder}, this class
* creates a new {@code DefaultModelBuilder} and equips it with the currently active components like {@link ModelProcessor}, {@link ModelValidator} etc.
* which might have been modified/provided by other Maven extensions.
*
* Works around thread safety issues when modifying the global singleton
* {@link org.apache.maven.model.building.DefaultModelBuilder DefaultModelBuilder}
* with custom {@link ProfileInjector} and {@link ProfileSelector}. Instead of modifying the global
* {@code DefaultModelBuilder}, this class
* creates a new {@code DefaultModelBuilder} and equips it with the currently active components like
* {@link ModelProcessor}, {@link ModelValidator} etc.
* which might have been modified/provided by other Maven extensions.
*
* @author Falko Modler
* @since 1.2.3
*/
Expand Down Expand Up @@ -104,7 +107,8 @@ public class ModelBuilderThreadSafetyWorkaround
@Inject
private ReportingConverter reportingConverter;

public ModelBuildingResult build( ModelBuildingRequest buildingRequest, ProfileInjector customInjector, ProfileSelector customSelector )
public ModelBuildingResult build( ModelBuildingRequest buildingRequest, ProfileInjector customInjector,
ProfileSelector customSelector )
throws ModelBuildingException
{
// note: there is neither DefaultModelBuilder.get*(), nor DefaultModelBuilder.clone()
Expand Down

0 comments on commit 592c8cd

Please sign in to comment.