0

My current plugin configuration works good and the part looks like:

   <plugin>
       <artifactId>maven-resources-plugin</artifactId>
        ....
       <configuration>
        ....
            <includes>
                <include>**/*.${file.type}</include>
            </includes>
       <configuration>

So that now I can use it like:

   mvn clean install -Pdeploy-files -Dfile.type=java

What I'm concerned about is how can I pass several file types which are not kind of 'hardcoded', for example:

   mvn clean install -Pdeploy-files -Dfile.type=java,class,war,tar

Is it possible with maven?

XZen
  • 225
  • 5
  • 27
  • 49
  • Can you elaborate a little bit more what you like to achieve? Using such things looks strange? – khmarbaise Feb 28 '14 at 07:51
  • I want to get some flexibility in my maven-resource-plugin config. For example, at the moment, I don't know which types of files we will need to upload, so I created this property ${file.type}. But what if I want to upload several types? For now I can call mvn several times - one time for each type of file. It sounds not good, especially because I know that it is possible to use several types in tag, for example: `**/*.txt**/*.class` – XZen Feb 28 '14 at 08:38
  • Uploading artifacts has nothing to do with maven-resources-plugin. If you have war,tar you have appropriate plugins for those purposes like maven-war-plugin, or maven-assembly-plugin (tar.gz, tar, zip) etc. But they will be produced by those plugins and as a result they will be uploaded. You are using a profile `deploy-files`which is the wrong way. There exists a life-cylce `deploy` (maven-deploy-plugin) – khmarbaise Feb 28 '14 at 08:41
  • @khmarbaise Sorry for (maybe) inappropriate examples, I meant *.txt, *.js, *.css files, not package-related files like war, tar, zip. – XZen Feb 28 '14 at 09:40

1 Answers1

0

Files like *.js, *.css should be part of the webapp folder which will be packaged into the war file where they belong. Other file? What kind of files? Apart from that you can use buildhelper-maven-plugin to attach other kind of files to your projects.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235