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

Added spotless plugin to build/plugins #1334

Merged
merged 1 commit into from
Jan 28, 2020

Conversation

seime
Copy link
Contributor

@seime seime commented Jan 18, 2020

See #1303

Signed-off-by: Arne Seime arne.seime@gmail.com

Signed-off-by: Arne Seime <arne.seime@gmail.com>
Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

I tested this in combination with #1303. Before we can merge this PR we have to apply the formatter again (PR #1335) and find a solution for the license headers in the feature files (see #1302 (comment)). Otherwise we will always face the following error:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.753 s (Wall Clock)
[INFO] Finished at: 2020-01-19T12:37:40+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:1.24.3:check (codestyle_check) on project org.openhab.core.tools.archetypes.binding: The following files had format violations:
[ERROR]     src/main/resources/archetype-resources/src/main/feature/feature.xml
[ERROR]         @@ -1,22 +1,12 @@
[ERROR]          <?xml·version="1.0"·encoding="UTF-8"?>
[ERROR]         -<!--
[ERROR]         -
[ERROR]         -\tCopyright·(c)·2010-2020·Contributors·to·the·openHAB·project
[ERROR]         -
[ERROR]         -\tSee·the·NOTICE·file(s)·distributed·with·this·work·for·additional
[ERROR]         -\tinformation.
[ERROR]         -
[ERROR]         -\tThis·program·and·the·accompanying·materials·are·made·available·under·the
[ERROR]         -\tterms·of·the·Eclipse·Public·License·2.0·which·is·available·at
[ERROR]         -\thttp://www.eclipse.org/legal/epl-2.0
[ERROR]         -
[ERROR]         -\tSPDX-License-Identifier:·EPL-2.0
[ERROR]         -
[ERROR]         --->
[ERROR]         +<!--·Copyright·(c)·2010-2020·Contributors·to·the·openHAB·project·See·the·NOTICE·file(s)·distributed·with·this·work·for·additional
[ERROR]         +\tinformation.·This·program·and·the·accompanying·materials·are·made·available·under·the·terms·of·the·Eclipse·Public·License
[ERROR]         +\t2.0·which·is·available·at·http://www.eclipse.org/legal/epl-2.0·SPDX-License-Identifier:·EPL-2.0·-->
[ERROR]          <features·name="${rootArtifactId}-${project.version}"·xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
[ERROR]          \t<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>
[ERROR]          
[ERROR]         -\t<feature·name="openhab-binding-${bindingId}"·description="${bindingIdCamelCase}·Binding"·version="${project.version}">\t
[ERROR]         +\t<feature·name="openhab-binding-${bindingId}"·description="${bindingIdCamelCase}·Binding"
[ERROR]         +\t\tversion="${project.version}">
[ERROR]          \t\t<feature>openhab-runtime-base</feature>
[ERROR]          \t\t<bundle·start-level="80">mvn:org.openhab.addons.bundles/${rootArtifactId}/${project.version}</bundle>
[ERROR]          \t</feature>
[ERROR] Run 'mvn spotless:apply' to fix these violations.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :org.openhab.core.tools.archetypes.binding

@cweitkamp cweitkamp added the awaiting other PR Depends on another PR label Jan 19, 2020
Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// EDIT: Wrong PR ...

LGTM. Thanks.

See also #1334 (review):

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  14.282 s
[INFO] Finished at: 2020-01-19T12:56:56+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:1.24.3:check (codestyle_check) on project org.openhab.addons.features.karaf.openhab-addons: The following files had format violations:
[ERROR]     src/main/resources/header.xml
[ERROR]         @@ -1,19 +1,7 @@
[ERROR]          <?xml·version="1.0"·encoding="UTF-8"?>
[ERROR]         -<!--
[ERROR]         -
[ERROR]         -\tCopyright·(c)·2010-2020·Contributors·to·the·openHAB·project
[ERROR]         -
[ERROR]         -\tSee·the·NOTICE·file(s)·distributed·with·this·work·for·additional
[ERROR]         -\tinformation.
[ERROR]         -
[ERROR]         -\tThis·program·and·the·accompanying·materials·are·made·available·under·the
[ERROR]         -\tterms·of·the·Eclipse·Public·License·2.0·which·is·available·at
[ERROR]         -\thttp://www.eclipse.org/legal/epl-2.0
[ERROR]         -
[ERROR]         -\tSPDX-License-Identifier:·EPL-2.0
[ERROR]         -
[ERROR]         --->
[ERROR]         +<!--·Copyright·(c)·2010-2020·Contributors·to·the·openHAB·project·See·the·NOTICE·file(s)·distributed·with·this·work·for·additional
[ERROR]         +\tinformation.·This·program·and·the·accompanying·materials·are·made·available·under·the·terms·of·the·Eclipse·Public·License
[ERROR]         +\t2.0·which·is·available·at·http://www.eclipse.org/legal/epl-2.0·SPDX-License-Identifier:·EPL-2.0·-->
[ERROR]          <features·name="${project.artifactId}-${project.version}"·xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
[ERROR]          
[ERROR]         -····<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>
[ERROR]         -
[ERROR]         +\t<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>
[ERROR] Run 'mvn spotless:apply' to fix these violations.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :org.openhab.addons.features.karaf.openhab-addons

@cweitkamp cweitkamp removed the awaiting other PR Depends on another PR label Jan 28, 2020
Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us merge this as it will not hurt and continue further discussion in #1303.

@cweitkamp cweitkamp merged commit e63db5f into openhab:master Jan 28, 2020
@wborn wborn added this to the 3.0 milestone Apr 6, 2020
Rosi2143 pushed a commit to Rosi2143/openhab-core that referenced this pull request Dec 26, 2020
…references to Joda and 'Instant' (openhab#1334)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants