Java application using Maven Build

129 views Asked by At

My project team is using maven build. We have a package name as **/**/**/RCS under which all the classes are getting generated. But the jar does not contain these classes for some reason. Is there a way to include these classes into the RCS.jar?

We are using maven build to compile all the modules in the application. There is no problem with other packages having a similar format.

Please suggest where the issue can be.

Thanks in advance!!!

This is the pom.xml for the package. Have removed certain dependencies.

<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>XX.4-1.Components.Oracle</groupId>
<artifactId>RCS</artifactId>
<version>4.1</version>
<packaging>jar</packaging>
<name>RCS</name>
<url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <archDeliveryPath>/home/user/BuildWorkspace/Product_Deployment/Dependent_Jars</archDeliveryPath>
  </properties>


<dependencies><dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>Oracle</groupId>
<artifactId>ojdbc5</artifactId>
<version>1.0</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>*</groupId>
 <artifactId>*</artifactId>
</exclusion>
 </exclusions>
</dependency>
<dependency>
<groupId>Oracle</groupId>
<artifactId>j2ee</artifactId>
<version>1.0</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>*</groupId>
 <artifactId>*</artifactId>
</exclusion>
 </exclusions>
</dependency>
<dependency>
<groupId>Oracle</groupId>
<artifactId>ErrorMessages</artifactId>
<version>1.0</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>*</groupId>
 <artifactId>*</artifactId>
</exclusion>
 </exclusions>
</dependency>
<dependency>
<groupId>ThirdpartyLicensedDependencyPOM</groupId>
<artifactId>License-Base</artifactId>
<version>1.0</version>
<type>pom</type>
</dependency>
<dependency><groupId>com.sum</groupId><artifactId>rt</artifactId><version>0.1</version><scope>system</scope><systemPath>${java.home}/lib/rt.jar</systemPath></dependency>
<dependency><groupId>com.sun</groupId><artifactId>tools</artifactId><version>0.1</version><scope>system</scope><systemPath>${java.home}/../lib/tools.jar</systemPath></dependency>
<dependency>
<groupId>XX.4-1.Components.Oracle</groupId>
<artifactId>XX</artifactId>
<version>(,4.1]</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>XX.4-1.Components.Oracle</groupId>
<artifactId>XX</artifactId>
<version>(,4.1]</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>ARCHPOM</groupId>
<artifactId>XX</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${archDeliveryPath}/XX.jar</systemPath>
</dependency>
<dependency>
<groupId>ARCHPOM</groupId>
<artifactId>CommonFunctionality</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${archDeliveryPath}/CommonFunctionality.jar</systemPath>
</dependency>

</dependencies>
<repositories>
<repository>
<id>id1</id>
<name>Artifactory</name>
<url>http://URL</url>
</repository>
<repository>
<id>Artifactory</id>
<name>Artifactory</name>
<url>http://URL</url>
</repository>
<repository>
<id>Artifactory</id>
<name>Artifactory-releases</name>
<url>http://URL</url>
</repository>
<repository>
<id>Licensed Artifactory</id>
<name>Artifactory-releases</name>
<url>http://URL</url>
</repository>
<repository>
<id>id4</id>
<name>Artifactory</name>
<url>http://URL</url>
</repository>
<repository>
<id>id3</id>
<name>Artifactory</name>
<url>http://URL</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>id2</id>
<name>Artifactory</name>
<url>http://URL</url>
</repository>
</distributionManagement>

</project>
2

There are 2 answers

3
carcaret On

Try adding this to your pom.xml

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <includes>
                    <include>**/RCS/*</include>
                </includes>
            </configuration>
        </plugin>
    </plugins>
</build>
0
Joseph On

the problem is resolved. Changed the default excludes in plexus-utils-2.0.5.jar/org/codehaus/plexus/util/AbstractScanner.java which was excluding **/RCS & **/RCS/**. Commented the RCS line and voila, it worked.