0

Build part of POM

<plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.2</version>
            <configuration>
               <classesDirectory>./</classesDirectory>
               <includes>
                  <include>*.wsdl</include>
                  <include>*.xsd</include>
                  <include>sources/</include>
                  <include>../configuration.doc</include>
               </includes>
            </configuration>
         </plugin>  

In target jar I have all wsdl from root dir, xsds from root dir and sources dir.
But no configuration.doc file in jar.

Any ideas?

peterh
  • 11,875
  • 18
  • 85
  • 108
Ilya
  • 29,135
  • 19
  • 110
  • 158

2 Answers2

2

You should move the configuration.doc into the appropriate directory like src/main/resources.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • 1
    Sou you start fighting against Maven but you will loose the combat. But furthermore why have you located the configuration.doc in a different location and the sources folder looks the same. The question is: Why don't you like to move it? Your personal tast or do you have a particular reason? – khmarbaise Jul 12 '12 at 09:45
  • This config file lay with parent pom file in all projects. And many script use this config files. So i can't move it – Ilya Jul 12 '12 at 10:33
  • 1
    Ok. Thats is by idea wrong. This means it's a resource which is used by others. Anyway. You can solve that problem by using the maven-assembly-plugin an repackaging the jar file and adding the configuration.doc file. You are working outside of the Maven conventions. – khmarbaise Jul 12 '12 at 10:53
0

How about adding the relevant folder from where you want the .doc to be picked up to your project pom using maven resources plugin - specifically the <resources> configuration - there are examples here. This will make the contents available to the jar plugin.

Raghuram
  • 51,854
  • 11
  • 110
  • 122