خرید بک لینک

Vote count: 0

I am using Jenkins for building maven project.

I have tow projects. Project_1 and project_2. for building both project together I have created parent pom.xml file. here is parent 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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.sam.batch</groupId>
  <artifactId>Parent_pom</artifactId>
        <packaging>pom</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>My Maven Webapp</name>
  <url>http://localhost:8081/nexus/content/repositories/releases</url>
  
  <!--<url>http://maven.apache.org</url> -->
  
  <modules>
    <module>project_1</module>
    <module>project_2</module>
  </modules>

 <distributionManagement>
    <snapshotRepository>
        <id>my-snapshots</id>
        <name>Inteal Repository</name>
        <url>http://localhost:8081/nexus/content/repositories/snapshots</url>


    </snapshotRepository>

    <repository>
        <id>my-releases</id>
        <name>Inteal Repository</name>
        <url>http://localhost:8081/nexus/content/repositories/releases</url>
        <!--url>http://localhost:8081/nexus/content/groups/public/</url-->
    </repository>
</distributionManagement>

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

</project>

Here is project_1 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/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.sam</groupId>
        <artifactId>project_1</artifactId>
        <packaging>war</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>Maven Webapp</name>
        <url>http://maven.apache.org</url>
        <!-- <url>http://localhost:8081/nexus/content/repositories/releases</url> -->
        <dependencies>

                <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>3.8.1</version>
                        <scope>test</scope>
                </dependency>

                <dependency>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                        <version>1.2.14</version>
                </dependency>

                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-webmvc</artifactId>
                        <version>3.2.13.RELEASE</version>
                </dependency>
                
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-web</artifactId>
                        <version>3.2.13.RELEASE</version>
                </dependency>

                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-core</artifactId>
                        <version>3.2.13.RELEASE</version>
                </dependency>

                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-context-support</artifactId>
                        <version>3.2.13.RELEASE</version>
                </dependency>

                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-jdbc</artifactId>
                        <version>3.2.13.RELEASE</version>
                </dependency>

                <dependency>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>
                        <version>2.2</version>
                </dependency>

                <dependency>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2</artifactId>
                        <version>1.6.2</version>
                </dependency>

                <dependency>
                        <groupId>org.apache.xmlbeans</groupId>
                        <artifactId>xmlbeans</artifactId>
                        <version>2.5.0</version>
                </dependency>

                <dependency>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-transport-http</artifactId>
                        <version>1.6.1</version>
                </dependency>
                
                <dependency>
                        <groupId>org.apache.ws.commons.axiom</groupId>
                        <artifactId>axiom-impl</artifactId>
                        <version>1.2.12</version>
                </dependency>
                
                <dependency>
                        <groupId>org.apache.ws.commons.schema</groupId>
                        <artifactId>XmlSchema</artifactId>
                        <version>1.4.7</version>
                </dependency>
                
                <dependency>
                        <groupId>org.apache.neethi</groupId>
                        <artifactId>neethi</artifactId>
                        <version>3.0.1</version>
                </dependency>
                
                <dependency>
                        <groupId>commons-httpclient</groupId>
                        <artifactId>commons-httpclient</artifactId>
                        <version>3.1</version>
                </dependency>
                
           <dependency>
                        <groupId>org.apache.httpcomponents</groupId>
                        <artifactId>httpcore</artifactId>
                        <version>4.0</version>
                </dependency>
                
                <dependency>
                        <groupId>org.codehaus.jackson</groupId>
                        <artifactId>jackson-mapper-asl</artifactId>
                        <version>1.9.13</version>
                </dependency>
                
        
                
                <dependency>
                    <groupId>javax</groupId>
                    <artifactId>javaee-api</artifactId>
                    <version>6.0</version>
                    <scope>provided</scope>
                </dependency>
                
                
        

        </dependencies>
        <build>
                <finalName>project_1</finalName>
                <resources>
                        <resource>
                                <directory>target/generated-sources/axis2/wsdl2code/resources</directory>
                        </resource>
                        <resource>
                                <directory>target/generated-sources/xmlbeans/resources</directory>
                        </resource>
                        <resource>
                                <directory>src/main/resources</directory>
                        </resource>                       
                </resources>
        </build>
</project>

Here is project_2 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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.sam.batch</groupId>
  <artifactId>project_2</artifactId>
        <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>Maven Webapp</name>
  <url>http://localhost:8081/nexus/content/repositories/releases</url>
 

  <dependencies>
                <!-- Spring ORM support -->
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-orm</artifactId>
                        <version>3.2.13.RELEASE</version>
                </dependency>

                <!-- Spring Batch -->
                <dependency>
                        <groupId>org.springframework.batch</groupId>
                        <artifactId>spring-batch-core</artifactId>
                        <version>3.0.1.RELEASE</version>
                </dependency>
                <dependency>
                        <groupId>org.springframework.batch</groupId>
                        <artifactId>spring-batch-infrastructure</artifactId>
                        <version>3.0.1.RELEASE</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2</artifactId>
                        <version>1.6.2</version>
                </dependency>

                <dependency>
                        <groupId>org.apache.xmlbeans</groupId>
                        <artifactId>xmlbeans</artifactId>
                        <version>2.5.0</version>
                </dependency>

                <dependency>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-transport-local</artifactId>
                        <version>1.6.1</version>
                </dependency>

                <dependency>
                        <groupId>org.apache.axis2</groupId>
                        <artifactId>axis2-transport-http</artifactId>
                        <version>1.6.1</version>
                </dependency>

                <dependency>
                        <groupId>commons-codec</groupId>
                        <artifactId>commons-codec</artifactId>
                        <version>1.6</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.poi</groupId>
                        <artifactId>poi</artifactId>
                        <version>3.9</version>
                </dependency>
                <dependency>
                        <groupId>org.hibeate.javax.persistence</groupId>
                        <artifactId>hibeate-jpa-2.0-api</artifactId>
                        <version>1.0.0.Final</version>
                </dependency>


                <dependency>
                        <groupId>org.hibeate</groupId>
                        <artifactId>hibeate-validator</artifactId>
                        <version>3.1.0.CR2</version>
                        <exclusions>
                                <exclusion>
                                        <groupId>org.slf4j</groupId>
                                        <artifactId>slf4j-api</artifactId>
                                </exclusion>
                        </exclusions>
                </dependency>
        
                <dependency>
                        <groupId>org.apache.geronimo.specs</groupId>
                        <artifactId>geronimo-stax-api_1.0_spec</artifactId>
                        <version>1.0.1</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.geronimo.specs</groupId>
                        <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
                        <version>1.1.2</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.ws.commons.axiom</groupId>
                        <artifactId>axiom-impl</artifactId>
                        <version>1.2.12</version>
                        <exclusions>
                                <exclusion>
                                        <artifactId>commons-logging</artifactId>
                                        <groupId>commons-logging</groupId>
                                </exclusion>
                        </exclusions>
                </dependency>
                <dependency>
                        <groupId>org.codehaus.woodstox</groupId>
                        <artifactId>wstx-asl</artifactId>
                        <version>3.2.9</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.geronimo.specs</groupId>
                        <artifactId>geronimo-jta_1.1_spec</artifactId>
                        <version>1.1</version>
                </dependency>
                <dependency>
                        <groupId>commons-httpclient</groupId>
                        <artifactId>commons-httpclient</artifactId>
                        <version>3.1</version>
                        <exclusions>
                                <exclusion>
                                        <artifactId>commons-logging</artifactId>
                                        <groupId>commons-logging</groupId>
                                </exclusion>
                        </exclusions>
                </dependency>
                <dependency>
                        <groupId>wsdl4j</groupId>
                        <artifactId>wsdl4j</artifactId>
                        <version>1.6.2</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.ws.commons.schema</groupId>
                        <artifactId>XmlSchema</artifactId>
                        <version>1.4.7</version>
                </dependency>
                <dependency>
                        <groupId>org.apache.httpcomponents</groupId>
                        <artifactId>httpcore</artifactId>
                        <version>4.0</version>
                </dependency>
                <dependency>
  <groupId>com.javaetmoi.core</groupId>
  <artifactId>javaetmoi-spring4-vfs2-support</artifactId>
  <version>1.4.0</version>
</dependency> 
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-core</artifactId>
                        <version>3.2.13.RELEASE</version>
                        <exclusions>
                                <exclusion>
                                        <artifactId>commons-logging</artifactId>
                                        <groupId>commons-logging</groupId>
                                </exclusion>
                        </exclusions>
                </dependency>
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-aop</artifactId>
                        <version>3.2.13.RELEASE</version>
                </dependency>
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-tx</artifactId>
                        <version>3.2.13.RELEASE</version>
                </dependency>
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-expression</artifactId>
                        <version>3.2.13.RELEASE</version>
                </dependency>
                <dependency>
                        <groupId>org.springframework.retry</groupId>
                        <artifactId>spring-retry</artifactId>
                        <version>1.0.3.RELEASE</version>
                </dependency>
                <dependency>
                        <groupId>javax.persistence</groupId>
                        <artifactId>persistence-api</artifactId>
                        <version>1.0</version>
                </dependency>
                
        

                


        </dependencies>
        
  
   <build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <version>3.1</version>
                                <configuration>
                                        <source>1.6</source>
                                        <target>1.6</target>
                                </configuration>
                        </plugin>
                        
                        

                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-dependency-plugin</artifactId>
                                <executions>
                                        <execution>
                                                <id>copy-dependencies</id>
                                                <phase>package</phase>
                                                <goals>
                                                        <goal>copy-dependencies</goal>
                                                </goals>
                                                <configuration>
                                                        <outputDirectory>${project.build.directory}</outputDirectory>
                                                        <overWriteReleases>false</overWriteReleases>
                                                        <overWriteSnapshots>true</overWriteSnapshots>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
                        
        
                        <resource>
                                <directory>target/generated-sources/axis2/wsdl2code/resources</directory>
                        </resource>
                        <resource>
                                <directory>target/generated-sources/xmlbeans/resources</directory>
                        </resource>
                        <resource>
                                <directory>src/main/resources</directory>
                        </resource>
                        <resource>
                                <directory>src/main/java/com/globalss/dnb/monitor/model/</directory>
                                <targetPath>com/globalss/dnb/monitor/model/</targetPath>
                                <includes>
                                        <include>*.hbm.xml</include>
                                </includes>
                        </resource>
                </resources>
    
  </build>
</project>

When I build these two project without using parent pom.xml I get both the project war file.

But When I am using parent pom.xml I don't get war files, though the projects get successfully build. But I don't see any war files.

This is the log from Jenkins

[INFO] Finished at: 2016-04-23T03:02:44+05:30
[INFO] Final Memory: 8M/176M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/jobs/project_1_Jenkins/workspace/project_1/pom.xml to com.sam/Project_1/1.0-SNAPSHOT/Project_1-1.0-SNAPSHOT.pom
[JENKINS] Archiving /var/lib/jenkins/jobs/project_1_Jenkins/workspace/test/pom.xml to com.sam.batch/project_2/0.0.1-SNAPSHOT/project_2-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /var/lib/jenkins/jobs/project_1_Jenkins/workspace/pom.xml to com.sam.batch/Parent_pom/0.0.1-SNAPSHOT/Parent_pom-0.0.1-SNAPSHOT.pom
chael stopped
Finished: SUCCESS

Where Am i lacking, Please help.

asked 47 secs ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 4 ارديبهشت 1395 ساعت: 17:26

صفحه بندی