r1874 - in trunk: . src/it/update-file-header src/it/update-file-header/src src/it/update-project-license src/it/update-project-license/src src/main src/main/java/org/nuiton/license/plugin src/main/resources/META-INF/plexus src/site/apt src/site/fr/apt src/test/java/org/nuiton/license/plugin src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/addLicense src/test/resources/org/nuiton/license
Author: tchemit Date: 2010-11-11 23:38:54 +0100 (Thu, 11 Nov 2010) New Revision: 1874 Url: http://nuiton.org/repositories/revision/maven-license-plugin/1874 Log: Evolution #1040: Remove licenseProjectDescriptor + do some cleaning Added: trunk/src/main/java/org/nuiton/license/plugin/AbstractLicenseNameMojo.java Removed: trunk/src/it/update-file-header/src/license/ trunk/src/it/update-project-license/src/license/ trunk/src/main/java/org/nuiton/license/plugin/AbstractLicenseWithDescriptorMojo.java trunk/src/main/mdo/ trunk/src/main/resources/META-INF/plexus/components.xml trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/addLicense/project.xml trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/all/project.xml trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/failLicense/project.xml trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/ignoreLicense/project.xml trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/updateLicense/project.xml trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/addLicense/project.xml trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/ignoreLicense/project.xml trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/updateLicense/project.xml trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/projectOne.xml trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/projectTwo.xml Modified: trunk/pom.xml trunk/src/it/update-file-header/pom.xml trunk/src/it/update-project-license/pom.xml trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java trunk/src/main/java/org/nuiton/license/plugin/UpdateProjectLicenseMojo.java trunk/src/site/apt/index.apt trunk/src/site/fr/apt/index.apt trunk/src/test/java/org/nuiton/license/plugin/UpdateFileHeaderMojoTest.java trunk/src/test/java/org/nuiton/license/plugin/UpdateProjectLicenseMojoTest.java trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/addLicense.xml trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/all.xml trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/failLicense.xml trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/ignoreLicense.xml trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/updateLicense.xml trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/addLicense.xml trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/ignoreLicense.xml trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/updateLicense.xml trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/testOne.xml trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/testTwo.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/pom.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -23,7 +23,9 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --> -<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/maven-v4_0_0.xsd"> +<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -130,13 +132,15 @@ <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> + <version>2.5</version> </dependency> - <dependency> + <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> + <version>1.1.1</version> </dependency> - + <!-- FIXME si on ne le rajoute pas, on se retrouve avec la version 1.1 qui ne convient pas --> <dependency> <groupId>org.codehaus.plexus</groupId> @@ -172,7 +176,7 @@ <version>${mavenVersion}</version> <scope>provided</scope> </dependency> - + <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> @@ -189,6 +193,7 @@ <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> + <version>1.2.16</version> <scope>runtime</scope> </dependency> @@ -292,6 +297,7 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> + <version>4.8.2</version> </dependency> </dependencies> @@ -348,9 +354,15 @@ <!-- Source control management. --> <scm> - <connection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</connection> - <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</developerConnection> - <url>http://www.nuiton.org/repositories/browse/maven-license-plugin/trunk</url> + <connection> + scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk + </connection> + <developerConnection> + scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk + </developerConnection> + <url> + http://www.nuiton.org/repositories/browse/maven-license-plugin/trunk + </url> </scm> <!-- ************************************************************* --> @@ -367,12 +379,9 @@ <!-- helper version --> <helperPluginVersion>1.2.9</helperPluginVersion> - <!-- license project descriptor model version --> - <mdoVersion>1.0.0</mdoVersion> - <!-- documentation is in apt format --> <siteSourcesType>apt</siteSourcesType> - + <!-- documentation is in english then french --> <locales>en,fr</locales> @@ -384,46 +393,6 @@ <plugins> - <!-- generate descriptor model + reader --> - <plugin> - <groupId>org.codehaus.modello</groupId> - <artifactId>modello-maven-plugin</artifactId> - <version>1.0</version> - <configuration> - <version>${mdoVersion}</version> - <lineLength>80</lineLength> - <useJava5>true</useJava5> - <models> - <model>src/main/mdo/descriptor.mdo</model> - </models> - </configuration> - <executions> - <execution> - <id>mdo</id> - <phase>generate-sources</phase> - <goals> - <goal>xpp3-reader</goal> - <goal>java</goal> - </goals> - <configuration> - <models> - <model>src/main/mdo/descriptor.mdo</model> - </models> - </configuration> - </execution> - <execution> - <id>mdo-xsd</id> - <phase>generate-resources</phase> - <goals> - <goal>xsd</goal> - </goals> - <configuration> - <outputDirectory>src/site/resources</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - <!-- expose new plexus components --> <plugin> <groupId>org.codehaus.plexus</groupId> @@ -449,6 +418,7 @@ <plugin> <groupId>org.nuiton</groupId> <artifactId>maven-license-plugin</artifactId> + <version>2.4.1</version> <configuration> <excludes> <exclude>**/it/ano-947/**</exclude> @@ -491,7 +461,8 @@ <pomInclude>evol-818/multimodule-filters/pom.xml</pomInclude> <pomInclude>evol-884/update-project-license/pom.xml</pomInclude> <pomInclude>evol-884/update-file-header/pom.xml</pomInclude> - <pomInclude>evol-884/update-file-header-specific/pom.xml</pomInclude> + <pomInclude>evol-884/update-file-header-specific/pom.xml + </pomInclude> <pomInclude>add-third-party/no-encoding/pom.xml</pomInclude> <pomInclude>aggregate-add-third-party/pom.xml</pomInclude> <pomInclude>add-third-party/merge-licenses/pom.xml</pomInclude> @@ -501,7 +472,8 @@ <pomInclude>update-project-license/pom.xml</pomInclude> </pomIncludes> <postBuildHookScript>verify</postBuildHookScript> - <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath> + <localRepositoryPath>${basedir}/target/local-repo + </localRepositoryPath> <settingsFile>src/it/settings.xml</settingsFile> <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo> <debug>${maven.verbose}</debug> Modified: trunk/src/it/update-file-header/pom.xml =================================================================== --- trunk/src/it/update-file-header/pom.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/it/update-file-header/pom.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -43,6 +43,7 @@ </organization> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <license.licenseName>gpl_v3</license.licenseName> </properties> <build> Modified: trunk/src/it/update-project-license/pom.xml =================================================================== --- trunk/src/it/update-project-license/pom.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/it/update-project-license/pom.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -45,6 +45,7 @@ </organization> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <license.licenseName>gpl_v3</license.licenseName> <license.generateBundle>true</license.generateBundle> <license.bundleLicensePath>META-INF/bundleLicense.txt</license.bundleLicensePath> <license.verbose>true</license.verbose> Copied: trunk/src/main/java/org/nuiton/license/plugin/AbstractLicenseNameMojo.java (from rev 1867, trunk/src/main/java/org/nuiton/license/plugin/AbstractLicenseWithDescriptorMojo.java) =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/AbstractLicenseNameMojo.java (rev 0) +++ trunk/src/main/java/org/nuiton/license/plugin/AbstractLicenseNameMojo.java 2010-11-11 22:38:54 UTC (rev 1874) @@ -0,0 +1,223 @@ +/* + * #%L + * Maven License Plugin + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit + * %% + * 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>. + * #L% + */ + +package org.nuiton.license.plugin; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.plugin.MojoFailureException; +import org.nuiton.license.plugin.model.License; +import org.nuiton.license.plugin.model.LicenseStore; +import org.nuiton.plugin.PluginWithEncoding; + +import java.util.Arrays; + +/** + * Abstract mojo which using a {@link #licenseName} and owns a + * {@link #licenseStore}. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.1 + */ +public abstract class AbstractLicenseNameMojo extends AbstractLicenseMojo implements PluginWithEncoding { + + /** + * Encoding used to read and writes files. + * <p/> + * <b>Note:</b> If nothing is filled here, we will use the system + * property {@code file.encoding}. + * + * @parameter expression="${license.encoding}" default-value="${project.build.sourceEncoding}" + * @required + * @since 2.1 + */ + private String encoding; + + /** + * To specify an external extra licenses repository resolver (says the base + * url of the repository where the {@code license.properties} is present). + * + * @parameter expression="${license.licenseResolver}" + * @since 2.1 + */ + private String licenseResolver; + + /** + * A flag to keep a backup of every modified file. + * + * @parameter expression="${license.keepBackup}" default-value="false" + * @since 2.1 + */ + private boolean keepBackup; + + /** + * Name of the license to use in the project. + * + * @parameter expression="${license.licenseName}" + * @since 2.4 + */ + private String licenseName; + + /** store of licenses */ + private LicenseStore licenseStore; + + /** + * When is sets to {@code true}, will skip execution. + * <p/> + * This will take effects in method {@link #checkSkip()}. + * So the method {@link #doAction()} will never be invoked. + * + * @return {@code true} if goal will not be executed + */ + public abstract boolean isSkip(); + + /** + * Changes internal state {@code skip} to execute (or not) goal. + * + * @param skip new state value + */ + public abstract void setSkip(boolean skip); + + @Override + protected boolean checkSkip() { + if (isSkip()) { + getLog().info("skip flag is on, will skip goal."); + return false; + } + return super.checkSkip(); + } + + @Override + protected void init() throws Exception { + + if (isSkip()) { + return; + } + + // init licenses store + LicenseStore licenseStore = createLicenseStore(getLicenseResolver()); + setLicenseStore(licenseStore); + + // check licenseName exists + checkLicense(licenseName); + } + + public License getMainLicense() + throws IllegalArgumentException, IllegalStateException, MojoFailureException { + + // check license exists + checkLicense(licenseName); + + // obtain license from his name + License mainLicense = getLicense(licenseName); + return mainLicense; + } + + public License getLicense(String licenseName) + throws IllegalArgumentException, IllegalStateException { + if (StringUtils.isEmpty(licenseName)) { + throw new IllegalArgumentException( + "licenseName can not be null, nor empty"); + } + LicenseStore licenseStore = getLicenseStore(); + if (licenseStore == null) { + throw new IllegalStateException("No license store initialized!"); + } + License mainLicense = licenseStore.getLicense(licenseName); + return mainLicense; + } + + /** + * Check if the given license name is valid (not null, nor empty) and + * exists in the license store. + * + * @param licenseName the name of the license to check + * @throws IllegalArgumentException if license is not valid + * @throws IllegalStateException if license store is not initialized + * @throws MojoFailureException if license does not exist + * @since 2.4.1 + */ + protected void checkLicense(String licenseName) + throws IllegalArgumentException, + IllegalStateException, MojoFailureException { + if (StringUtils.isEmpty(licenseName)) { + throw new IllegalArgumentException( + "licenseName can not be null, nor empty"); + } + LicenseStore licenseStore = getLicenseStore(); + if (licenseStore == null) { + throw new IllegalStateException("No license store initialized!"); + } + License mainLicense = licenseStore.getLicense(licenseName); + if (mainLicense == null) { + throw new MojoFailureException( + "License named '" + mainLicense + + "' is unknown, use one of " + + Arrays.toString(licenseStore.getLicenseNames())); + } + } + + @Override + public final String getEncoding() { + return encoding; + } + + @Override + public final void setEncoding(String encoding) { + this.encoding = encoding; + } + + public boolean isKeepBackup() { + return keepBackup; + } + + public String getLicenseName() { + return licenseName; + } + + public String getLicenseResolver() { + return licenseResolver; + } + + public LicenseStore getLicenseStore() { + return licenseStore; + } + + public void setKeepBackup(boolean keepBackup) { + this.keepBackup = keepBackup; + } + + public void setLicenseResolver(String licenseResolver) { + this.licenseResolver = licenseResolver; + } + + public void setLicenseName(String licenseName) { + this.licenseName = licenseName; + } + + public void setLicenseStore(LicenseStore licenseStore) { + this.licenseStore = licenseStore; + } + +} Property changes on: trunk/src/main/java/org/nuiton/license/plugin/AbstractLicenseNameMojo.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Deleted: trunk/src/main/java/org/nuiton/license/plugin/AbstractLicenseWithDescriptorMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/AbstractLicenseWithDescriptorMojo.java 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/main/java/org/nuiton/license/plugin/AbstractLicenseWithDescriptorMojo.java 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,339 +0,0 @@ -/* - * #%L - * Maven License Plugin - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - * %% - * 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>. - * #L% - */ - -package org.nuiton.license.plugin; - -import org.apache.commons.lang.StringUtils; -import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.project.MavenProject; -import org.nuiton.license.plugin.model.License; -import org.nuiton.license.plugin.model.LicenseStore; -import org.nuiton.license.plugin.model.descriptor.LicenseProjectDescriptor; -import org.nuiton.license.plugin.model.descriptor.io.xpp3.LicenseProjectDescriptorXpp3Reader; -import org.nuiton.plugin.PluginWithEncoding; - -import java.io.File; -import java.io.FileReader; -import java.util.Arrays; - -/** - * Abstract mojo which using {@link #descriptor} file and owns a - * {@link #licenseStore}. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.1 - */ -public abstract class AbstractLicenseWithDescriptorMojo extends AbstractLicenseMojo implements PluginWithEncoding { - - /** - * Encoding used to read and writes files. - * <p/> - * <b>Note:</b> If nothing is filled here, we will use the system - * property {@code file.encoding}. - * - * @parameter expression="${license.encoding}" default-value="${project.build.sourceEncoding}" - * @required - * @since 2.1 - */ - private String encoding; - - /** - * The project license descriptor file. - * <p/> - * <b>Note:</b> This parameter is no more required as it will be removed in - * version 3. - * - * @parameter expression="${license.descriptor}" default-value="src/license/project.xml" - * @since 2.1 - * @deprecated since 2.4.1, in version 3 we will no more use descriptor - */ - @Deprecated - private File descriptor; - - /** - * To specify an external extra licenses repository resolver (says the base - * url of the repository where the {@code license.properties} is present). - * - * @parameter expression="${license.licenseResolver}" - * @since 2.1 - */ - private String licenseResolver; - - /** - * A flag to keep a backup of every modified file. - * - * @parameter expression="${license.keepBackup}" default-value="false" - * @since 2.1 - */ - private boolean keepBackup; - - /** - * Name of the license to use in the project. - * - * @parameter expression="${license.licenseName}" - * @since 2.4 - */ - private String licenseName; - - /** store of licenses */ - private LicenseStore licenseStore; - - /** - * descriptor of project. - * - * @deprecated since 2.4.1, in version 3 we will no more use a descriptor file to describe project license. - */ - @Deprecated - private LicenseProjectDescriptor licenseProjectDescriptor; - - /** - * When is sets to {@code true}, will skip execution. - * <p/> - * This will take effects in method {@link #checkSkip()}. - * So the method {@link #doAction()} will never be invoked. - * - * @return {@code true} if goal will not be executed - */ - public abstract boolean isSkip(); - - /** - * Changes internal state {@code skip} to execute (or not) goal. - * - * @param skip new state value - */ - public abstract void setSkip(boolean skip); - - @Override - protected boolean checkSkip() { - if (isSkip()) { - getLog().info("skip flag is on, will skip goal."); - return false; - } - return super.checkSkip(); - } - - @Override - protected void init() throws Exception { - - if (isSkip()) { - return; - } - - // init licenses store - LicenseStore licenseStore = createLicenseStore(getLicenseResolver()); - setLicenseStore(licenseStore); - - // load project descriptor - File descriptorFile = new File(getDescriptor().getAbsolutePath()); - if (!descriptorFile.exists()) { - - // try to find the file in the direct parent module - MavenProject mavenProject = getProject().getParent(); - if (mavenProject != null) { - - File basedir = getProject().getBasedir(); - - // try with the parent - String path = descriptorFile.getAbsolutePath().substring( - basedir.getAbsolutePath().length() + 1); - setDescriptor(new File(mavenProject.getBasedir() + - File.separator + path)); - if (isVerbose()) { - getLog().info("try in parent module " + getDescriptor()); - } - - } - descriptorFile = new File(getDescriptor().getAbsolutePath()); - } - - if (!descriptorFile.exists()) { - - // No descriptor File: use no descriptor - - // check licenseName exists - checkLicense(licenseName); - - return; - } - - // Will use the deprecated license project descriptor - - getLog().warn("\n"); - getLog().warn("-----------------------------------------------------------------------------------"); - getLog().warn("The usage of License descriptor file is deprecated and will be removed in version 3"); - getLog().warn("-----------------------------------------------------------------------------------"); - getLog().warn("\n"); - - getLog().info("Loading descriptor " + descriptorFile); - LicenseProjectDescriptor licenseProject = null; - FileReader reader = new FileReader(descriptorFile); - try { - licenseProject = - new LicenseProjectDescriptorXpp3Reader().read(reader); - setLicenseProjectDescriptor(licenseProject); - - } finally { - reader.close(); - } - - // check that license project is sane (known licenses + header types) - // + populate default license name in LicenseSet (with main License) if - // none given for licenseSet - validateLicenseProjectDescriptor(licenseProject); - } - - @Deprecated - protected void validateLicenseProjectDescriptor(LicenseProjectDescriptor licenseProjectDescriptor) throws MojoFailureException { - String mainLicense = licenseProjectDescriptor.getMainLicense(); - - checkLicense(mainLicense); - - setLicenseName(mainLicense); - } - - public License getMainLicense() - throws IllegalArgumentException, IllegalStateException, MojoFailureException { -// LicenseProjectDescriptor licenseProject = getLicenseProjectDescriptor(); -// if (licenseProject != null) { -// -// // use the main license from the license project descriptor -// licenseName = licenseProject.getMainLicense(); -// } - - // check license exists - checkLicense(licenseName); - - // obtain license from his name - License mainLicense = getLicense(licenseName); - return mainLicense; - } - - public License getLicense(String licenseName) - throws IllegalArgumentException, IllegalStateException { - if (StringUtils.isEmpty(licenseName)) { - throw new IllegalArgumentException( - "licenseName can not be null, nor empty"); - } - LicenseStore licenseStore = getLicenseStore(); - if (licenseStore == null) { - throw new IllegalStateException("No license store initialized!"); - } - License mainLicense = licenseStore.getLicense(licenseName); - return mainLicense; - } - - /** - * Check if the given license name is valid (not null, nor empty) and - * exists in the license store. - * - * @param licenseName the name of the license to check - * @throws IllegalArgumentException if license is not valid - * @throws IllegalStateException if license store is not initialized - * @throws MojoFailureException if license does not exist - * @since 2.4.1 - */ - protected void checkLicense(String licenseName) - throws IllegalArgumentException, - IllegalStateException, MojoFailureException { - if (StringUtils.isEmpty(licenseName)) { - throw new IllegalArgumentException( - "licenseName can not be null, nor empty"); - } - LicenseStore licenseStore = getLicenseStore(); - if (licenseStore == null) { - throw new IllegalStateException("No license store initialized!"); - } - License mainLicense = licenseStore.getLicense(licenseName); - if (mainLicense == null) { - throw new MojoFailureException( - "License named '" + mainLicense + - "' is unknown, use one of " + - Arrays.toString(licenseStore.getLicenseNames())); - } - } - - @Override - public final String getEncoding() { - return encoding; - } - - @Override - public final void setEncoding(String encoding) { - this.encoding = encoding; - } - - @Deprecated - public File getDescriptor() { - return descriptor; - } - - public boolean isKeepBackup() { - return keepBackup; - } - - public String getLicenseName() { - return licenseName; - } - - public String getLicenseResolver() { - return licenseResolver; - } - - public LicenseStore getLicenseStore() { - return licenseStore; - } - - @Deprecated - public LicenseProjectDescriptor getLicenseProjectDescriptor() { - return licenseProjectDescriptor; - } - - public void setKeepBackup(boolean keepBackup) { - this.keepBackup = keepBackup; - } - - @Deprecated - public void setDescriptor(File descriptor) { - this.descriptor = descriptor; - } - - public void setLicenseResolver(String licenseResolver) { - this.licenseResolver = licenseResolver; - } - - public void setLicenseName(String licenseName) { - this.licenseName = licenseName; - } - - public void setLicenseStore(LicenseStore licenseStore) { - this.licenseStore = licenseStore; - } - - @Deprecated - public void setLicenseProjectDescriptor( - LicenseProjectDescriptor licenseProjectDescriptor) { - this.licenseProjectDescriptor = licenseProjectDescriptor; - } -} Modified: trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java 2010-11-11 22:38:54 UTC (rev 1874) @@ -26,23 +26,14 @@ package org.nuiton.license.plugin; import org.apache.commons.lang.StringUtils; -import org.apache.maven.plugin.MojoFailureException; import org.codehaus.plexus.util.FileUtils; import org.nuiton.license.plugin.header.FileHeader; import org.nuiton.license.plugin.header.FileHeaderProcessor; import org.nuiton.license.plugin.header.FileHeaderProcessorConfiguration; import org.nuiton.license.plugin.header.InvalideFileHeaderException; import org.nuiton.license.plugin.header.UpdateFileHeaderFilter; -import org.nuiton.license.plugin.header.transformer.AptFileHeaderTransformer; import org.nuiton.license.plugin.header.transformer.FileHeaderTransformer; -import org.nuiton.license.plugin.header.transformer.JavaFileHeaderTransformer; -import org.nuiton.license.plugin.header.transformer.PropertiesFileHeaderTransformer; -import org.nuiton.license.plugin.header.transformer.RstFileHeaderTransformer; -import org.nuiton.license.plugin.header.transformer.XmlFileHeaderTransformer; import org.nuiton.license.plugin.model.License; -import org.nuiton.license.plugin.model.descriptor.FileSet; -import org.nuiton.license.plugin.model.descriptor.Header; -import org.nuiton.license.plugin.model.descriptor.LicenseProjectDescriptor; import org.nuiton.plugin.PluginHelper; import java.io.File; @@ -60,8 +51,7 @@ import java.util.TreeMap; /** - * The goal to update (or add) the header on some files described in - * {@link #descriptor} file. + * The goal to update (or add) the header on project source files. * <p/> * This goal replace the {@code update-header} goal which can not deal with * Copyright. @@ -74,7 +64,7 @@ * @goal update-file-header * @since 2.1 */ -public class UpdateFileHeaderMojo extends AbstractLicenseWithDescriptorMojo implements FileHeaderProcessorConfiguration { +public class UpdateFileHeaderMojo extends AbstractLicenseNameMojo implements FileHeaderProcessorConfiguration { /** * Name of project (or module). @@ -421,17 +411,6 @@ super.init(); - // this block will be removed in version 3 - if (getLicenseProjectDescriptor() != null) { - - // use the main license from the license project descriptor - setLicenseName(getLicenseProjectDescriptor().getMainLicense()); - - // get all files to treate indexed by their comment style - filesToTreateByCommentStyle = obtainFilesToTreateByCommentStyle(); - return; - } - if (roots == null || roots.length == 0) { roots = DEFAULT_ROOTS; if (isVerbose()) { @@ -514,64 +493,6 @@ result.put(commentStyle, new ArrayList<File>()); } - // this block will be removed in version 3 - if (getLicenseProjectDescriptor() != null) { - - List<Header> headers = getLicenseProjectDescriptor().getHeaders(); - - for (Header header : headers) { - - String commentStyle = header.getCommentStyle(); - - List<File> filesForCS = result.get(commentStyle); - - for (FileSet fileSet : header.getFileSets()) { - - File basedir = new File(getProject().getBasedir(), - fileSet.getBasedir()); - if (getLog().isDebugEnabled()) { - getLog().debug(" - process file set with basedir : " + basedir); - } - - List<String> includes = fileSet.getIncludes(); - if (includes.isEmpty()) { - - // it means include all - includes.add("**/*"); - } - List<String> excludes = fileSet.getExcludes(); - - Map<File, String[]> filestoTreate = new TreeMap<File, String[]>(); - - // obtain files to treate - getFilesToTreateForRoots( - includes.toArray(new String[includes.size()]), - excludes.isEmpty() ? null : - excludes.toArray(new String[excludes.size()]), - Arrays.asList(basedir.getAbsolutePath()), - filestoTreate, - null - ); - - try { - for (Map.Entry<File, String[]> entry : - filestoTreate.entrySet()) { - - File rootFile = entry.getKey(); - - for (String path : entry.getValue()) { - - filesForCS.add(new File(rootFile, path)); - } - } - } finally { - filestoTreate.clear(); - } - } - } - return result; - } - List<String> rootsList = new ArrayList<String>(roots.length); for (String root : roots) { File f = new File(root); @@ -583,6 +504,10 @@ if (f.exists()) { getLog().info("Will search files to update from root " + f); rootsList.add(f.getAbsolutePath()); + } else { + if (isVerbose()) { + getLog().info("Skip not found root " + f); + } } } @@ -999,36 +924,6 @@ return result; } - /** - * Obtain the known Comment style from the given extension - * - * @param extension the extension to match with a comment style - * @return the known comment style, or null if not found - */ - protected String getCommentStyleForExtenion(String extension) { - - // trim the extension - extension = extension.trim(); - - if (JavaFileHeaderTransformer.NAME.equalsIgnoreCase(extension)) { - return JavaFileHeaderTransformer.NAME; - } - if (XmlFileHeaderTransformer.NAME.equalsIgnoreCase(extension)) { - return XmlFileHeaderTransformer.NAME; - } - if (AptFileHeaderTransformer.NAME.equalsIgnoreCase(extension)) { - return AptFileHeaderTransformer.NAME; - } - if (PropertiesFileHeaderTransformer.NAME.equalsIgnoreCase(extension)) { - return PropertiesFileHeaderTransformer.NAME; - } - if (RstFileHeaderTransformer.NAME.equalsIgnoreCase(extension)) { - return RstFileHeaderTransformer.NAME; - } - - return null; - } - public FileHeaderTransformer getTransformer(String transformerName) throws IllegalArgumentException, IllegalStateException { if (StringUtils.isEmpty(transformerName)) { @@ -1048,70 +943,6 @@ return transformer; } - @Override - protected void validateLicenseProjectDescriptor(LicenseProjectDescriptor licenseProjectDescriptor) - throws MojoFailureException { - - super.validateLicenseProjectDescriptor(licenseProjectDescriptor); - - String mainLicense = licenseProjectDescriptor.getMainLicense(); - - Header singleHeader = licenseProjectDescriptor.getHeader(); - if (singleHeader != null) { - - // add it to set (and remove it from single) - licenseProjectDescriptor.addHeader(singleHeader); - licenseProjectDescriptor.setHeader(null); - } - - for (Header header : licenseProjectDescriptor.getHeaders()) { - - String headerType = header.getCommentStyle(); - - if (getTransformer(headerType) == null) { - throw new MojoFailureException( - "headerType '" + headerType + - "' is unknown, use one of " + transformers.keySet()); - } - String licenseName = header.getLicenseName(); - if (StringUtils.isEmpty(licenseName)) { - - // use the main license - header.setLicenseName(mainLicense); - } else { - - // check license name - checkLicense(licenseName); - } - - FileSet singleFileSet = header.getFileSet(); - if (singleFileSet != null) { - - // add it to set (and remove it from single) - header.addFileSet(singleFileSet); - header.setFileSet(null); - } - for (FileSet fileSet : header.getFileSets()) { - - String singleInclude = fileSet.getInclude(); - if (singleInclude != null) { - - // add it to set (and remove it from single) - fileSet.addInclude(singleInclude); - fileSet.setInclude(null); - } - - String singleExclude = fileSet.getExclude(); - if (singleExclude != null) { - - // add it to set (and remove it from single) - fileSet.addExclude(singleExclude); - fileSet.setExclude(null); - } - } - } - } - public boolean isClearAfterOperation() { return clearAfterOperation; } Modified: trunk/src/main/java/org/nuiton/license/plugin/UpdateProjectLicenseMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/UpdateProjectLicenseMojo.java 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/main/java/org/nuiton/license/plugin/UpdateProjectLicenseMojo.java 2010-11-11 22:38:54 UTC (rev 1874) @@ -32,10 +32,10 @@ /** * Updates (or creates) the main project license file according to the given - * license project {@link #descriptor}. + * license defines as {@link #licenseName}. * <p/> - * Can also generate a bundle license file (to avoid collision names in - * class-path). This file is by default generate in + * Can also generate a bundled license file (to avoid collision names in + * class-path). This file is by default generated in * {@code META-INF class-path directory}. * <p/> * <b>Note:</b> this goal replace {@code add-license} one (which does not @@ -47,7 +47,7 @@ * @requiresProject true * @since 2.1 */ -public class UpdateProjectLicenseMojo extends AbstractLicenseWithDescriptorMojo { +public class UpdateProjectLicenseMojo extends AbstractLicenseNameMojo { /** * Project license file to synchronize with main license defined in Deleted: trunk/src/main/resources/META-INF/plexus/components.xml =================================================================== --- trunk/src/main/resources/META-INF/plexus/components.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/main/resources/META-INF/plexus/components.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> -<component-set> - <components> - <component> - <role>org.codehaus.plexus.velocity.VelocityComponent</role> - <role-hint>maven-license-plugin</role-hint> - <implementation>org.codehaus.plexus.velocity.DefaultVelocityComponent</implementation> - <configuration> - <properties> - <property> - <name>resource.loader</name> - <value>file,classpath</value> - </property> - <property> - <name>classpath.resource.loader.class</name> - <value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value> - </property> - <property> - <name>file.resource.loader.class</name> - <value>org.apache.velocity.runtime.resource.loader.FileResourceLoader</value> - </property> - </properties> - </configuration> - </component> - </components> -</component-set> \ No newline at end of file Modified: trunk/src/site/apt/index.apt =================================================================== --- trunk/src/site/apt/index.apt 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/site/apt/index.apt 2010-11-11 22:38:54 UTC (rev 1874) @@ -34,6 +34,12 @@ The process tags are separated by space otherwise plugin can NOT update header of this file! +What's new in version 3.0 + + As planned, license descriptor was removed from project. + + <<Projet will migrate to Codehaus>> under the name of <<license-maven-plugin>>. + What's new in version 2.4 et 2.4.1 We would like not to use any longer project description file since it is too Modified: trunk/src/site/fr/apt/index.apt =================================================================== --- trunk/src/site/fr/apt/index.apt 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/site/fr/apt/index.apt 2010-11-11 22:38:54 UTC (rev 1874) @@ -36,6 +36,12 @@ Dans la documentation, les tags de process sont séparés par des espaces où le plugin ne pourrait PAS gérer la license de ces fichiers ! +Quoi de neuf dans la version 3.0 + + On a supprimé les fichiers de descriptions dépréciés en 2.4. + + <<Le projet migre sur Codehaus>> sous le nom de <<license-maven-plugin>>. + Quoi de neuf dans la version 2.4 et 2.4.1 On voudrait ne plus utiliser les fichiers de descriptions d'en-tête introduits Modified: trunk/src/test/java/org/nuiton/license/plugin/UpdateFileHeaderMojoTest.java =================================================================== --- trunk/src/test/java/org/nuiton/license/plugin/UpdateFileHeaderMojoTest.java 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/java/org/nuiton/license/plugin/UpdateFileHeaderMojoTest.java 2010-11-11 22:38:54 UTC (rev 1874) @@ -26,6 +26,7 @@ package org.nuiton.license.plugin; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.nuiton.plugin.AbstractMojoTest; import org.nuiton.plugin.PluginHelper; @@ -66,6 +67,12 @@ mojo.clear(); } + @Override + protected void setUpMojo(UpdateFileHeaderMojo mojo, File pomFile) throws Exception { + super.setUpMojo(mojo, pomFile); + mojo.getProject().setBasedir(new File(mojo.getProject().getBasedir(),getMethodName())); + } + @Test public void addLicense() throws Exception { Modified: trunk/src/test/java/org/nuiton/license/plugin/UpdateProjectLicenseMojoTest.java =================================================================== --- trunk/src/test/java/org/nuiton/license/plugin/UpdateProjectLicenseMojoTest.java 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/java/org/nuiton/license/plugin/UpdateProjectLicenseMojoTest.java 2010-11-11 22:38:54 UTC (rev 1874) @@ -53,8 +53,7 @@ // license is where the pom is File outputDirectory = pomFile.getParentFile(); mojo.setOutputDirectory(outputDirectory); - mojo.setDescriptor( - new File(outputDirectory, mojo.getDescriptor().getName())); +// mojo.setDescriptor(new File(outputDirectory, mojo.getDescriptor().getName())); if (!outputDirectory.exists()) { if (!outputDirectory.mkdirs()) { throw new IOException( Deleted: trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/addLicense/project.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/addLicense/project.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/addLicense/project.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,45 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - -<project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-1.0.0.xsd"> - <mainLicense>gpl_v3</mainLicense> - <headers> - <header> - <licenseName>lgpl_v3</licenseName> - <commentStyle>java</commentStyle> - <fileSets> - <fileSet> - <basedir>addLicense/src</basedir> - <includes> - <include>**/*.java</include> - </includes> - </fileSet> - </fileSets> - </header> - </headers> -</project> Modified: trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/addLicense.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/addLicense.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/addLicense.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -42,9 +42,7 @@ <groupId>org.nuiton</groupId> <artifactId>maven-license-plugin</artifactId> <configuration> - <descriptor> - target/test-classes/org/nuiton/license/plugin/updateFileHeaderMojoTest/addLicense/project.xml - </descriptor> + <licenseName>lgpl_v3</licenseName> <projectName>Project name : maven-license-plugin-java</projectName> <organizationName>Organization is CodeLutin</organizationName> <inceptionYear>2010</inceptionYear> Deleted: trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/all/project.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/all/project.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/all/project.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,45 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - -<project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-1.0.0.xsd"> - <mainLicense>gpl_v3</mainLicense> - <headers> - <header> - <licenseName>lgpl_v3</licenseName> - <commentStyle>java</commentStyle> - <fileSets> - <fileSet> - <basedir>all/src</basedir> - <includes> - <include>**/*.java</include> - </includes> - </fileSet> - </fileSets> - </header> - </headers> -</project> Modified: trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/all.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/all.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/all.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -41,9 +41,7 @@ <groupId>org.nuiton</groupId> <artifactId>maven-license-plugin</artifactId> <configuration> - <descriptor> - target/test-classes/org/nuiton/license/plugin/updateFileHeaderMojoTest/all/project.xml - </descriptor> + <licenseName>lgpl_v3</licenseName> <projectName>Project name : maven-license-plugin-java</projectName> <organizationName>Organization is CodeLutin</organizationName> <inceptionYear>2010</inceptionYear> Deleted: trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/failLicense/project.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/failLicense/project.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/failLicense/project.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,47 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - -<project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-1.0.0.xsd"> - <mainLicense>gpl_v3</mainLicense> - - <headers> - <header> - <licenseName>lgpl_v3</licenseName> - <commentStyle>java</commentStyle> - <fileSets> - <fileSet> - <basedir>failLicense/src</basedir> - <includes> - <include>**/*.java</include> - </includes> - </fileSet> - </fileSets> - </header> - </headers> - -</project> Modified: trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/failLicense.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/failLicense.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/failLicense.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -41,9 +41,7 @@ <groupId>org.nuiton</groupId> <artifactId>maven-license-plugin</artifactId> <configuration> - <descriptor> - target/test-classes/org/nuiton/license/plugin/updateFileHeaderMojoTest/failLicense/project.xml - </descriptor> + <licenseName>lgpl_v3</licenseName> <projectName>NEVER_FINd_ME!</projectName> <organizationName>NEVER_FINd_ME!</organizationName> <inceptionYear>2010</inceptionYear> Deleted: trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/ignoreLicense/project.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/ignoreLicense/project.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/ignoreLicense/project.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,45 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - -<project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-1.0.0.xsd"> - <mainLicense>gpl_v3</mainLicense> - <headers> - <header> - <licenseName>lgpl_v3</licenseName> - <commentStyle>java</commentStyle> - <fileSets> - <fileSet> - <basedir>ignoreLicense/src</basedir> - <includes> - <include>**/*.java</include> - </includes> - </fileSet> - </fileSets> - </header> - </headers> -</project> Modified: trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/ignoreLicense.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/ignoreLicense.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/ignoreLicense.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -41,9 +41,7 @@ <groupId>org.nuiton</groupId> <artifactId>maven-license-plugin</artifactId> <configuration> - <descriptor> - target/test-classes/org/nuiton/license/plugin/updateFileHeaderMojoTest/ignoreLicense/project.xml - </descriptor> + <licenseName>lgpl_v3</licenseName> <projectName>NEVER_FINd_ME!</projectName> <organizationName>NEVER_FINd_ME!</organizationName> <inceptionYear>2010</inceptionYear> Deleted: trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/updateLicense/project.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/updateLicense/project.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/updateLicense/project.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,46 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - - -<project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-1.0.0.xsd"> - <mainLicense>gpl_v3</mainLicense> - <headers> - <header> - <licenseName>lgpl_v3</licenseName> - <commentStyle>java</commentStyle> - <fileSets> - <fileSet> - <basedir>updateLicense/src</basedir> - <includes> - <include>**/*.java</include> - </includes> - </fileSet> - </fileSets> - </header> - </headers> -</project> Modified: trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/updateLicense.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/updateLicense.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateFileHeaderMojoTest/updateLicense.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -42,9 +42,7 @@ <groupId>org.nuiton</groupId> <artifactId>maven-license-plugin</artifactId> <configuration> - <descriptor> - target/test-classes/org/nuiton/license/plugin/updateFileHeaderMojoTest/updateLicense/project.xml - </descriptor> + <licenseName>lgpl_v3</licenseName> <projectName>Project name : maven-license-plugin-java</projectName> <organizationName>Organization is CodeLutin</organizationName> <inceptionYear>2010</inceptionYear> Deleted: trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/addLicense/project.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/addLicense/project.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/addLicense/project.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,45 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - -<project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProject-1.0.0.xsd"> - <mainLicense>gpl_v3</mainLicense> - <licenseSets> - <licenseSet> - <licenseName>lgpl_v3</licenseName> - <fileSets> - <fileSet> - <headerType>java</headerType> - <basedir>addLicense/src</basedir> - <includes> - <include>**/*.java</include> - </includes> - </fileSet> - </fileSets> - </licenseSet> - </licenseSets> -</project> Modified: trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/addLicense.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/addLicense.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/addLicense.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -42,9 +42,7 @@ <groupId>org.nuiton</groupId> <artifactId>maven-license-plugin</artifactId> <configuration> - <descriptor> - target/test-classes/org/nuiton/license/plugin/updateLicenseMojoTest/addLicense/project.xml - </descriptor> + <licenseName>lgpl_v3</licenseName> <projectName>Project name : maven-license-plugin-java</projectName> <organizationName>Organization is CodeLutin</organizationName> <inceptionYear>2010</inceptionYear> Deleted: trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/ignoreLicense/project.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/ignoreLicense/project.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/ignoreLicense/project.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,45 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - -<project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProject-1.0.0.xsd"> - <mainLicense>gpl_v3</mainLicense> - <licenseSets> - <licenseSet> - <licenseName>lgpl_v3</licenseName> - <fileSets> - <fileSet> - <headerType>java</headerType> - <basedir>ignoreLicense/src</basedir> - <includes> - <include>**/*.java</include> - </includes> - </fileSet> - </fileSets> - </licenseSet> - </licenseSets> -</project> Modified: trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/ignoreLicense.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/ignoreLicense.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/ignoreLicense.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -41,9 +41,7 @@ <groupId>org.nuiton</groupId> <artifactId>maven-license-plugin</artifactId> <configuration> - <descriptor> - target/test-classes/org/nuiton/license/plugin/updateLicenseMojoTest/ignoreLicense/project.xml - </descriptor> + <licenseName>lgpl_v3</licenseName> <projectName>NEVER_FINd_ME!</projectName> <organizationName>NEVER_FINd_ME!</organizationName> <inceptionYear>2010</inceptionYear> Deleted: trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/updateLicense/project.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/updateLicense/project.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/updateLicense/project.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,46 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - - -<project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProject-1.0.0.xsd"> - <mainLicense>gpl_v3</mainLicense> - <licenseSets> - <licenseSet> - <licenseName>lgpl_v3</licenseName> - <fileSets> - <fileSet> - <headerType>java</headerType> - <basedir>updateLicense/src</basedir> - <includes> - <include>**/*.java</include> - </includes> - </fileSet> - </fileSets> - </licenseSet> - </licenseSets> -</project> Modified: trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/updateLicense.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/updateLicense.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateLicenseMojoTest/updateLicense.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -42,9 +42,7 @@ <groupId>org.nuiton</groupId> <artifactId>maven-license-plugin</artifactId> <configuration> - <descriptor> - target/test-classes/org/nuiton/license/plugin/updateLicenseMojoTest/updateLicense/project.xml - </descriptor> + <licenseName>lgpl_v3</licenseName> <projectName>Project name : maven-license-plugin-java</projectName> <organizationName>Organization is CodeLutin</organizationName> <inceptionYear>2010</inceptionYear> Deleted: trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/projectOne.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/projectOne.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/projectOne.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,31 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - -<project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-1.0.0.xsd"> - <mainLicense>lgpl_v3</mainLicense> -</project> Deleted: trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/projectTwo.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/projectTwo.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/projectTwo.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -1,31 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - #%L - Maven License Plugin - - $Id$ - $HeadURL$ - %% - Copyright (C) 2008 - 2010 CodeLutin, Tony Chemit - %% - 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>. - #L% - --> - -<project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-1.0.0.xsd"> - <mainLicense>gpl_v3</mainLicense> -</project> Modified: trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/testOne.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/testOne.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/testOne.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -41,9 +41,8 @@ <artifactId>maven-license-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> - <descriptor>${basedir}/projectOne.xml</descriptor> + <licenseName>lgpl_v3</licenseName> <licenseFile>licenseOne.txt</licenseFile> - <!--<outputDirectory>test</outputDirectory>--> <verbose>true</verbose> </configuration> <executions> Modified: trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/testTwo.xml =================================================================== --- trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/testTwo.xml 2010-11-11 21:20:22 UTC (rev 1873) +++ trunk/src/test/resources/org/nuiton/license/plugin/updateProjectLicenseMojoTest/testTwo.xml 2010-11-11 22:38:54 UTC (rev 1874) @@ -41,7 +41,7 @@ <artifactId>maven-license-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> - <descriptor>projectTwo.xml</descriptor> + <licenseName>gpl_v3</licenseName> <licenseFile>licenseTwo.txt</licenseFile> <verbose>true</verbose> </configuration>
participants (1)
-
tchemit@users.nuiton.org