Code Monkey home page Code Monkey logo

maven-rbc-plugin's Introduction

Maven Resource Bundle Check Plugin

Historical note: This plugin used to be called maven-rbc-plugin

The resource bundle check plugin rbc-maven-plugin runs some checks on your resource files using underneath the ResourceCheck Ant task.

What is it good for?

  • Runs various checks on resource files, such as missing language resources files or missing resource entries
  • Can create a Maven report of the check results

Check out the plugin web site for details.

Example report

Development

  • Build the plugin

    mvn clean install

    Make sure you got Maven 3.0.3+ or higher.

  • Build the site (and the optional example report)

    mvn clean install site -Psite,example-report

    mvn site:deploy -Psite,dist-labs

  • Release

    mvn release:prepare

    mvn release:perform

Make sure you got the changes etc for the site updated previous to the release.

maven-rbc-plugin's People

Contributors

marcelmay avatar markuss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

maven-rbc-plugin's Issues

Unable to build from source

I'm using maven-3.0.4 and when run "mvn clean install" with skip unit tests switch, build fail because integration tests. This log is generated in target/it/check-goal/build.log

Apache Maven 3.0.4 (r1232337; 2012-01-17 06:44:56-0200)
Maven home: C:_ambiente\apache-maven-3.0.4
Java version: 1.6.0_21, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_21\jre
Default locale: pt_BR, platform encoding: Cp1252
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Resource Bundle Check Test 0.6-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ rbc-maven-plugin-check-test ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ rbc-maven-plugin-check-test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ rbc-maven-plugin-check-test ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Documents and Settings\p-fdourado\Desktop\marcelmay-maven-rbc-plugin-2febccf\target\it\check-goal\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ rbc-maven-plugin-check-test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ rbc-maven-plugin-check-test ---
[INFO] No tests to run.
[INFO] Surefire report directory: C:\Documents and Settings\p-fdourado\Desktop\marcelmay-maven-rbc-plugin-2febccf\target\it\check-goal\target\surefire-reports


T E S T S

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- rbc-maven-plugin:0.6-SNAPSHOT:check (check) @ rbc-maven-plugin-check-test ---
Downloading: http://repo.maven.apache.org/maven2/net/sf/rscbundlecheck/rscbundlecheck/1.31/rscbundlecheck-1.31.pom
[WARNING] The POM for net.sf.rscbundlecheck:rscbundlecheck:jar:1.31 is missing, no dependency information available
Downloading: http://repo.maven.apache.org/maven2/net/sf/rscbundlecheck/rscbundlecheck/1.31/rscbundlecheck-1.31.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.218s
[INFO] Finished at: Thu Jul 05 19:38:12 BRT 2012
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.metacube.maven:rbc-maven-plugin:0.6-SNAPSHOT:check (check) on project rbc-maven-plugin-check-test: Execution check of goal net.metacube.maven:rbc-maven-plugin:0.6-SNAPSHOT:check failed: Plugin net.metacube.maven:rbc-maven-plugin:0.6-SNAPSHOT or one of its dependencies could not be resolved: Failure to find net.sf.rscbundlecheck:rscbundlecheck:jar:1.31 in http://maven/maven_repo/repositories/release was cached in the local repository, resolution will not be reattempted until the update interval of InternalPlugin has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.metacube.maven:rbc-maven-plugin:0.6-SNAPSHOT:check (check) on project rbc-maven-plugin-check-test: Execution check of goal net.metacube.maven:rbc-maven-plugin:0.6-SNAPSHOT:check failed: Plugin net.metacube.maven:rbc-maven-plugin:0.6-SNAPSHOT or one of its dependencies could not be resolved: Failure to find net.sf.rscbundlecheck:rscbundlecheck:jar:1.31 in http://maven/maven_repo/repositories/release was cached in the local repository, resolution will not be reattempted until the update interval of InternalPlugin has elapsed or updates are forced
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution check of goal net.metacube.maven:rbc-maven-plugin:0.6-SNAPSHOT:check failed: Plugin net.metacube.maven:rbc-maven-plugin:0.6-SNAPSHOT or one of its dependencies could not be resolved: Failure to find net.sf.rscbundlecheck:rscbundlecheck:jar:1.31 in http://maven/maven_repo/repositories/release was cached in the local repository, resolution will not be reattempted until the update interval of InternalPlugin has elapsed or updates are forced
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:82)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin net.metacube.maven:rbc-maven-plugin:0.6-SNAPSHOT or one of its dependencies could not be resolved: Failure to find net.sf.rscbundlecheck:rscbundlecheck:jar:1.31 in http://maven/maven_repo/repositories/release was cached in the local repository, resolution will not be reattempted until the update interval of InternalPlugin has elapsed or updates are forced
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:215)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm(DefaultMavenPluginManager.java:353)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm(DefaultMavenPluginManager.java:321)
at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(DefaultBuildPluginManager.java:175)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:78)
... 20 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure to find net.sf.rscbundlecheck:rscbundlecheck:jar:1.31 in http://maven/maven_repo/repositories/release was cached in the local repository, resolution will not be reattempted until the update interval of InternalPlugin has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:207)
... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find net.sf.rscbundlecheck:rscbundlecheck:jar:1.31 in http://maven/maven_repo/repositories/release was cached in the local repository, resolution will not be reattempted until the update interval of InternalPlugin has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:230)
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:204)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:427)
... 27 more
[ERROR]
[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/PluginResolutionException

Invoking rbc:report leads to stack overflow

Using version 0.6:

mvn rbc:report
...

Exception in thread "main" java.lang.StackOverflowError
        at de.m3y.maven.rscbundlecheck.rscbundlecheck.ReportResourceBundleMojo.$getCallSiteArray(ReportResourceBundleMojo.groovy)
        at de.m3y.maven.rscbundlecheck.rscbundlecheck.ReportResourceBundleMojo.getOutputDirectory(ReportResourceBundleMojo.groovy)
        at org.apache.maven.reporting.AbstractMavenReport.getReportOutputDirectory(AbstractMavenReport.java:215)
        at org.apache.maven.reporting.MavenReport$getReportOutputDirectory.callCurrent(Unknown Source)
        at de.m3y.maven.rscbundlecheck.rscbundlecheck.ReportResourceBundleMojo.getOutputDirectory(ReportResourceBundleMojo.groovy:307)
        at org.apache.maven.reporting.AbstractMavenReport.getReportOutputDirectory(AbstractMavenReport.java:215)

Build does not fail when failOnError is set true

That is my plugin configuration:

        <plugin>
            <groupId>net.metacube.maven</groupId>
            <artifactId>maven-rbc-plugin</artifactId>
            <version>0.5</version>
            <executions>
                <execution>
                    <id>check</id>
                    <phase>package</phase>
                    <goals>
                        <goal>check</goal>
                    </goals>
                    <inherited>false</inherited>
                    <configuration>
                        <failOnError>true</failOnError>
                        <enabledChecks>
                            <param>cross bundle check</param>
                            <param>duplicate key check</param>
                            <param>empty key check</param>
                        </enabledChecks>
                        <fileset>
                            <directory>src/main/resources</directory>
                            <includes>
                                <include>messages/*.properties</include>
                            </includes>
                        </fileset>
                    </configuration>
                </execution>
            </executions>
        </plugin>

Maven build show "BUILD SUCCESS" instead of fail when properties file is wrong like missing resource keys.

We are using multi-module, this can be the problem?

Failed to execute goal de.m3y.maven:rbc-maven-plugin ... required class SinkEventAttributes missing

org.apache.maven.reporting:maven-reporting-api:3.0 references org.apache.maven.doxia:doxia-sink-api:1.0 but org.apache.maven.doxia:doxia-sink-api:1.2 is required for org.apache.maven.reporting:maven-reporting-impl:2.2

[ERROR] Failed to execute goal de.m3y.maven:rbc-maven-plugin:0.7-SNAPSHOT:report (default-cli) on project rbc-maven-plugin-report-test: Execution default-cli of goal de.m3y.maven:rbc-maven-plugin:0.7-SNAPSHOT:report failed: A required class was missing while executing de.m3y.maven:rbc-maven-plugin:0.7-SNAPSHOT:report: org/apache/maven/doxia/sink/SinkEventAttributes
[ERROR] urls[18] = file:/Users/mm/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0/doxia-sink-api-1.0.jar
[ERROR] urls[20] = file:/Users/mm/.m2/repository/org/apache/maven/doxia/doxia-core/1.2/doxia-core-1.2.jar
[ERROR] urls[21] = file:/Users/mm/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.2/doxia-logging-api-1.2.jar
[ERROR] urls[28] = file:/Users/mm/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.2/doxia-site-renderer-1.2.jar
[ERROR] urls[29] = file:/Users/mm/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.2/doxia-decoration-model-1.2.jar
[ERROR] urls[30] = file:/Users/mm/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.2/doxia-module-xhtml-1.2.jar
[ERROR] urls[31] = file:/Users/mm/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.2/doxia-module-fml-1.2.jar
[ERROR] -----------------------------------------------------: org.apache.maven.doxia.sink.SinkEventAttributes

Fix plugin artifact name

Artifact Ids of the format maven-___-plugin are reserved for
plugins in the Group Id org.apache.maven.plugins
Please change your artifactId to the format ___-maven-plugin
In the future this error will break the build.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.