Mahabub
Mahabub

Reputation: 541

mvn Install not adding any file other than .class file

My project structure as follows

pom.xml
src
 |
 Main.Java
 test.xml

when i run mvn install i see in the jar file has Main.class but test.xml is not included in the jar file. How to add it in jar file

Upvotes: 1

Views: 213

Answers (1)

LynAs
LynAs

Reputation: 6567

add this to your pom

<build>
    <resources>
        <resource>
            <directory>src</directory>
            <includes>
                <include>**/**</include>
            </includes>
        </resource>
    </resources>

    <sourceDirectory>src</sourceDirectory>
    <plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5</version>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
        </configuration>
    </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.0.2</version>
        </plugin>
    </plugins>
</build>

Upvotes: 1

Related Questions