0

I have an project which I converted to a Maven project using eclipse then I configured pom.xml and added all the dependency jars to it and then i build the EAR using maven build options in eclipse install -e but the ear created does not contain any source code in it. There are only jars inside the ear.

Can anybody please help me out and let me know how to get code added in the 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.Avizva.FBVision</groupId>
  <artifactId>Enrollment_GUID</artifactId>
  <packaging>ear</packaging>
  <name>Enrollment_GUID</name>
  <build>
    <sourceDirectory>${basedir}/src</sourceDirectory>
    <resources>
      <resource>
        <directory>${basedir}/src</directory>
        <includes>
        <include>**/*.properties</include>
         <include>**/*.java</include>
        </includes>

      </resource>
    </resources>

    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <warSourceDirectory>WebContent</warSourceDirectory>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-1.2-api</artifactId>
        <version>2.0-rc1</version>
    </dependency>

    <dependency>
        <groupId>org.kie.modules</groupId>
        <artifactId>org-apache-commons-lang3</artifactId>
        <version>6.1.0.CR1</version>
        <type>pom</type>

    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>1.7.7</version>
    </dependency>
<dependency>
    <groupId>joda-time</groupId>
    <artifactId>joda-time</artifactId>
    <version>2.3</version>
</dependency>
    <dependency>
        <groupId>org.apache.directory.studio</groupId>
        <artifactId>org.apache.commons.lang</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <groupId>aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>1.5.4</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-asm</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-expression</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
    <groupId>net.sf.dozer</groupId>
    <artifactId>dozer</artifactId>
    <version>5.3.2</version>
    </dependency>

    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-adb</artifactId>
        <version>1.6.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-kernel</artifactId>
        <version>1.6.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-local</artifactId>
    <version>1.6.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-http</artifactId>
    <version>1.6.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-api</artifactId>
    <version>1.2.13</version>
    </dependency>
    <dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-impl</artifactId>
    <version>1.2.13</version>
    </dependency>
    <dependency>
        <groupId>antlr</groupId>
        <artifactId>antlr</artifactId>
        <version>2.7.5</version>
    </dependency>
    <dependency>
        <groupId>aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>1.5.4</version>
    </dependency>
    <dependency>
    <groupId>org.apache.ws.schema</groupId>
    <artifactId>XmlSchema</artifactId>
    <version>1.4.5</version>
    </dependency>
  </dependencies>

  <version>1</version>
</project>
user2439680
  • 11
  • 1
  • 3
  • 1
    Why would you want source code in your EAR file? – Robby Cornelissen Jun 26 '14 at 05:42
  • @RobbyCornelissen Why wouldn't you? I'm afraid it's [turtles all the way down](http://en.wikipedia.org/wiki/Turtles_all_the_way_down). – Elliott Frisch Jun 26 '14 at 05:49
  • I think this link may help you: http://maven.apache.org/plugins/maven-ear-plugin/usage.html Or, look at this answer: http://stackoverflow.com/questions/1134894/maven2-best-practice-for-enterprise-project-ear-file – MrYo Jun 26 '14 at 05:49
  • When I create a normal ear from eclipse there is a WAR file in that EAR which contains WEB-INF folder which contains all the classes, lib ,property files and xml files required by application but when I am trying to build ear through maven only META-INF folder is created in it with all the dependency Jar inside it basically I need that WAR inside my EAR which should contain all the classes and other files. – user2439680 Jun 26 '14 at 05:52
  • @user3777807 Please [edit](http://stackoverflow.com/posts/24423117/edit) your question and include that information. – Elliott Frisch Jun 26 '14 at 05:53
  • You have to configure the `maven-ear-plugin`. – Seelenvirtuose Jun 26 '14 at 06:01
  • I will do it later on but first I am stuck with maven-compiler-plugin the code is getting compiled but exported to the default location target/classes folder. Is there any way i can put it my customised location WebContent/WEB-INF/classes. I used the following configuration in the maven-compiler-plugin but it is not working ${basedir}/WebContent/WEB-INF/classes – user2439680 Jun 26 '14 at 08:17

0 Answers0