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

Goal "files" doesn't work with maven-2.2.1 #44

Closed
anomen-s opened this issue Jul 13, 2016 · 1 comment
Closed

Goal "files" doesn't work with maven-2.2.1 #44

anomen-s opened this issue Jul 13, 2016 · 1 comment
Labels
Milestone

Comments

@anomen-s
Copy link

I tried simple use of "files" goal, but I was not able to make it work with maven-2.2.1. In maven-3.0+, this works fine:

<build>
<plugins>
<plugin>
  <groupId>net.ju-n.maven.plugins</groupId>
  <artifactId>checksum-maven-plugin</artifactId>
  <version>1.3</version>
  <executions>
   <execution>
   <phase>process-resources</phase>
  <goals>
   <goal>files</goal>
  </goals>
  <configuration>
    <algorithms>
      <algorithm>MD5</algorithm>
    </algorithms>
    <quiet>true</quiet>
    <fileSets>
      <fileSet>
        <directory>${project.build.directory}/custom/statechart/data</directory>
      </fileSet>
    </fileSets>
  </configuration>
</execution>
</executions>
</plugin>
[DEBUG] Configuring mojo 'net.ju-n.maven.plugins:checksum-maven-plugin:1.3:files' -->
[DEBUG]   (f) algorithms = [MD5]
[DEBUG]   (f) attachChecksums = false
[DEBUG]   (f) csvSummary = true
[DEBUG]   (f) csvSummaryFile = checksums.csv
[DEBUG]   (f) encoding = UTF-8
[DEBUG]   (f) failOnError = true
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: net.ju-n.maven.plugins:checksum-maven-plugin:1.3



Cause: Error loading class 'net.nicoulaj.maven.plugins.checksum.mojo.FileSet'
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error configuring: net.ju-n.maven.plugins:checksum-maven-plugin. Reason: Unable to parse the created DOM for plugin configuration
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:723)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.PluginConfigurationException: Error configuring: net.ju-n.maven.plugins:checksum-maven-plugin. Reason: Unable to parse the created DOM for plugin configuration
    at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1363)
    at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:724)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:468)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException: Error loading class 'net.nicoulaj.maven.plugins.checksum.mojo.FileSet'
    at org.codehaus.plexus.component.configurator.converters.composite.CollectionConverter.fromConfiguration(CollectionConverter.java:170)
    at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:247)
    at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
    at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56)
    at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1357)
    ... 20 more
Caused by: java.lang.ClassNotFoundException: net.nicoulaj.maven.plugins.checksum.mojo.FileSet
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
    at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
    at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
    at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at org.codehaus.plexus.component.configurator.converters.composite.CollectionConverter.fromConfiguration(CollectionConverter.java:158)
    ... 24 more
@nicoulaj
Copy link
Owner

Indeed, the plugin does not support maven 2 anymore.

I set the minimum required version to Maven 3.0.4, so now it will fail with the right message:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.217s
[INFO] Finished at: Fri Nov 18 22:45:52 CET 2016
[INFO] Final Memory: 27M/271M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.ju-n.maven.plugins:checksum-maven-plugin:1.4-SNAPSHOT:artifacts (default) on project attached-artifacts.artifacts.xml-summary-file: The plugin net.ju-n.maven.plugins:checksum-maven-plugin:1.4-SNAPSHOT requires Maven version 3.2.0 -> [Help 1]

I configured the continuous integration to test all Maven versions since 3.0.4 on JDK 6/7/8: https://travis-ci.org/nicoulaj/checksum-maven-plugin

@nicoulaj nicoulaj added this to the 1.4 milestone Nov 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants