maven include resources in jar
-
I have a component for apache-tapestry, which includes java js, js, cs. There are no resource files in the jar-e pool. The js files themselves, the css are not in.
src/main/resources
and in a java bag of classes. How do you tell the meven that when the project is assembled, it includes them in jar?My pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
<groupId>com.inlandia.tap5.components</groupId> <artifactId>inlandia-components</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>Inlandia Components Library</name> <dependencies> <dependency> <groupId>org.apache.tapestry</groupId> <artifactId>tapestry-core</artifactId> <version>${tapestry-release-version}</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> <source>1.8</source> <target>1.8</target> <optimize>true</optimize> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifestEntries> <Tapestry-Module-Classes>com.inlandia.tap5.services.InlandiaModule </Tapestry-Module-Classes> </manifestEntries> </archive> </configuration> </plugin> </plugins> </build> <repositories> <repository> <id>codehaus.snapshots</id> <url>http://snapshots.repository.codehaus.org</url> </repository> <repository> <id>OpenQA_Release</id> <name>OpenQA Release Repository</name> <url>http://archiva.openqa.org/repository/releases/</url> </repository> </repositories> <properties> <tapestry-release-version>5.4-rc-1</tapestry-release-version> </properties>
</project>
-
Add something like that:
<build> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> </build>
Use the directives
include
andexclude
♪https://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html