r561 - in trunk: . src/main/java/org/nuiton src/main/java/org/nuiton/util src/site src/site/apt
Author: tchemit Date: 2009-08-29 19:33:31 +0200 (Sat, 29 Aug 2009) New Revision: 561 Added: trunk/src/main/java/org/nuiton/CheckChangelogPlugin.java Modified: trunk/changelog.txt trunk/src/main/java/org/nuiton/util/SourceEntry.java trunk/src/site/apt/index.apt trunk/src/site/site.xml Log: add a check-changelog-file goal to detect existence of the changelog.txt file for root module of project. Modified: trunk/changelog.txt =================================================================== --- trunk/changelog.txt 2009-08-29 16:50:54 UTC (rev 560) +++ trunk/changelog.txt 2009-08-29 17:33:31 UTC (rev 561) @@ -2,6 +2,7 @@ * [FEATURE] improve code + add some usefull methods for plugin * [FEATURE] add some documentation on site + use apt format (no deps to jrst) + * [FEATURE] add a check-changelog-file goal to detect existence of the changelog.txt file for root module of project. -- chemit -- ??? Added: trunk/src/main/java/org/nuiton/CheckChangelogPlugin.java =================================================================== --- trunk/src/main/java/org/nuiton/CheckChangelogPlugin.java (rev 0) +++ trunk/src/main/java/org/nuiton/CheckChangelogPlugin.java 2009-08-29 17:33:31 UTC (rev 561) @@ -0,0 +1,63 @@ +/* + * *##% + * Maven helper plugin + * Copyright (C) 2009 CodeLutin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * ##%* + */ +package org.nuiton; + +import java.io.File; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.project.MavenProject; + +/** + * Check that the changelog exists on standalone module or root module of a + * multi-module project. + * + * @goal check-changelog-file + * @requiresProject true + * @phase validate + * @author chemit + * @since 1.0.2 + */ +public class CheckChangelogPlugin extends AbstractMojo { + + /** + * Dependance du projet. + * + * @parameter default-value="${project}" + * @required + * @since 1.0.2 + */ + protected MavenProject project; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + if (project.isExecutionRoot()) { + File f = new File(project.getBasedir(), "changelog.txt"); + if (!f.exists()) { + throw new MojoExecutionException("the module " + project.getName() + " requires the file " + f.getAbsolutePath()); + } else { + getLog().info("changelog file dectected : " + f.getAbsolutePath()); + } + } else { + getLog().info("skip for module " + project.getName() + " (not a root module)"); + } + } +} Property changes on: trunk/src/main/java/org/nuiton/CheckChangelogPlugin.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Modified: trunk/src/main/java/org/nuiton/util/SourceEntry.java =================================================================== --- trunk/src/main/java/org/nuiton/util/SourceEntry.java 2009-08-29 16:50:54 UTC (rev 560) +++ trunk/src/main/java/org/nuiton/util/SourceEntry.java 2009-08-29 17:33:31 UTC (rev 561) @@ -1,5 +1,5 @@ /* - * *##% + * *##% * Maven helper plugin * Copyright (C) 2009 CodeLutin * Modified: trunk/src/site/apt/index.apt =================================================================== --- trunk/src/site/apt/index.apt 2009-08-29 16:50:54 UTC (rev 560) +++ trunk/src/site/apt/index.apt 2009-08-29 17:33:31 UTC (rev 561) @@ -26,6 +26,8 @@ * {{{add-license-mojo.html} helper:add-license}} add license file and third-party files to classpath (generate them if necessary). * {{{add-third-party-mojo.html} helper:add-third-party}} write the licenses of all third-party libraries used in project. + + * {{{check-changelog-file-mojo.html} helper:check-changelog-file}} check the root module of project has a changelog.txt file. * {{{help-mojo.html} helper:help}} display help about the plugin (goals, usage). Modified: trunk/src/site/site.xml =================================================================== --- trunk/src/site/site.xml 2009-08-29 16:50:54 UTC (rev 560) +++ trunk/src/site/site.xml 2009-08-29 17:33:31 UTC (rev 561) @@ -43,6 +43,7 @@ <item name="add-license" href="add-license-mojo.html"/> <item name="add-third-party" href="add-third-party-mojo.html"/> <item name="available-licenses" href="available-licenses-mojo.html"/> + <item name="check-changelog-file" href="check-changelog-file-mojo.html"/> <item name="help" href="help-mojo.html"/> <item name="runJava" href="runJava-mojo.html"/> </item>
participants (1)
-
tchemit@users.nuiton.org