Giter Club home page Giter Club logo

copy-maven-plugin's People

Contributors

antibrumm avatar tomerc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

copy-maven-plugin's Issues

dependency on plexus utils missing?

I had to add the plexus utils dependency in a POM that uses copy-maven-plugin

Before I got

[ERROR] Failed to execute goal ch.mfrey.maven.plugin:copy-maven-plugin:1.0.0:copy (autodeploy-expath-pkgs-for-appassembler) on project exist-distribution: Execution autodeploy-expath-pkgs-for-appassembler of goal ch.mfrey.maven.plugin:copy-maven-plugin:1.0.0:copy failed: A required class was missing while executing ch.mfrey.maven.plugin:copy-maven-plugin:1.0.0:copy: org/codehaus/plexus/util/FileUtils

Adding

 <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
       <version>1.1</version>
   </dependency>

Did solve the issue.
I do wonder which version of plexus-utils would be optimal and also why this dependency is not declared.

Required class was missing error with maven 3.9.1

After upgrading maven from 3.8.x to 3.9.1, the following build error occurs:

[ERROR] Failed to execute goal ch.mfrey.maven.plugin:copy-maven-plugin:1.0.0:copy (copy-youtube-video-player-images-for-war) on project my-project: Execution copy-youtube-video-player-images-for-war of goal ch.mfrey.maven.plugin:copy-maven-plugin:1.0.0:copy failed: A required class was missing while executing ch.mfrey.maven.plugin:copy-maven-plugin:1.0.0:copy: org/codehaus/plexus/util/FileUtils
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>ch.mfrey.maven.plugin:copy-maven-plugin:1.0.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/v:/maven/.m2/repository/ch/mfrey/maven/plugin/copy-maven-plugin/1.0.0/copy-maven-plugin-1.0.0.jar
[ERROR] urls[1] = file:/v:/maven/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
[ERROR] Number of foreign imports: 1

Workaround

A workaround is to add org.codehaus.plexus:plexus-utils:3.5.0 artifact as dependency of the plugin ch.mfrey.maven.plugin:copy-maven-plugin as follows:

        <plugin>
          <groupId>ch.mfrey.maven.plugin</groupId>
          <artifactId>copy-maven-plugin</artifactId>
          <version>1.0.0</version>
          <dependencies>
			<dependency>
			    <groupId>org.codehaus.plexus</groupId>
			    <artifactId>plexus-utils</artifactId>
			    <version>3.5.0</version>
			</dependency>
          </dependencies>
        </plugin>

Copy from target to destination causes an error

I get the following log:

"
[INFO] --- copy-maven-plugin:0.0.1:copy (copy) @ skp-foundation ---
[INFO] Resource:
WorkingDir: D:\dev\LR\skp\workspace\skp-foundation\target
Paths:
D:\dev\LR\skp\workspace\skp-foundation\target -> D:\dev\LR\skp\liferay-portal-6.2-ee-sp10\deploy\tomcat-7.0.42\lib\ext
Replaces:

[INFO]

  • D:\dev\LR\skp\workspace\skp-foundation\target\skp-foundation.jar
  • D:\dev\LR\skp\workspace\skp-foundation\target\skp-foundation.jar
    "

The Paths output is correct but the last output lines starting with - and + is incorrect. The destination folder is not correctly set.

Here is also my configuration:

<plugin>
                <groupId>ch.mfrey.maven.plugin</groupId>
                <artifactId>copy-maven-plugin</artifactId>
                <version>0.0.1</version>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <showfiles>true</showfiles>
                            <resources>
                                <resource>
                                    <directory>${project.build.directory}</directory>
                                    <move>true</move>
                                    <includes>
                                        <include>*.jar</include>
                                    </includes>
                                    <paths>
                                        <path>
                                            <from>${project.build.directory}</from>
                                            <to>${liferay.app.server.lib.global.dir}</to>
                                        </path>
                                    </paths>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Allow replacing by empty string

Thanks for the great Maven plugin! I have a small issue though. If I have something like this as a replacement:

<replace>
    <from>some_text</from>
    <to>${some.var}</to>
</replace>

And if then some.var is empty, I get the following error during execution:

15:14:50  [ERROR] Failed to execute goal ch.mfrey.maven.plugin:copy-maven-plugin:1.0.0:copy (some-execution-id) on project some.proj.name: Execution some-execution-id of goal ch.mfrey.maven.plugin:copy-maven-plugin:1.0.0:copy failed: Cannot invoke "java.lang.CharSequence.toString()" because "replacement" is null -> [Help 1]

The longer stack trace is:

Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "replacement" is null
    java.lang.String.replace (String.java:2961)
    ch.mfrey.maven.plugin.copy.CopyMojo.copyFile (CopyMojo.java:76)
    ch.mfrey.maven.plugin.copy.CopyMojo.execute (CopyMojo.java:126)
    org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    ...

The crash happens here. The 2nd argument to String.replace is null. It appears that Maven provides null for empty to rather than an empty string.

It would be great to be able to replace by an empty string. I think it would be easy to fix: just check for null, and use an empty string instead.

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.