0

Target FolderI was using ANT before but I have switched to Maven so pretty new with it . I have set the packaging to JAR in pom.xml. But my question is where can I find this jar file (location) once the build is passed. Where can I set the location in pom.xml and along with it do I have to add any jar plugins in the pom. CMD output

<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>tiger</groupId>
    <artifactId>SampleProject</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>SampleProject</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.45.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.13</version>
        </dependency>

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

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.6</version>
        </dependency>

        <!-- //for reportng(guice ,velocity is added) -->
        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.4</version>
        </dependency>

        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>3.0</version>
        </dependency>

        <dependency>
            <groupId>velocity</groupId>
            <artifactId>velocity-dep</artifactId>
            <version>1.4</version>
        </dependency>

    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>

                    <configuration>
                        <suiteXmlFiles>
                            <suiteXmlFile>testng.xml</suiteXmlFile>
                        </suiteXmlFiles>
                    </configuration>

                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <!-- <reporting> <plugins> TestNG-xslt related configuration. <plugin> <groupId>org.reportyng</groupId> 
        <artifactId>reporty-ng</artifactId> <version>1.2</version> <configuration> 
        Output directory for the testng xslt report <outputDir>/target/testng-xslt-report</outputDir> 
        <sortTestCaseLinks>true</sortTestCaseLinks> <testDetailsFilter>FAIL,SKIP,PASS,CONF,BY_CLASS</testDetailsFilter> 
        <showRuntimeTotals>true</showRuntimeTotals> </configuration> </plugin> </plugins> 
        </reporting> -->


</project>
Adam Grunt
  • 207
  • 1
  • 3
  • 16

3 Answers3

1

Ok guys I guess the problem was the Chrome browser , I tried running the same tests with Firefox it ran fine , got the BUILD SUCCESS message and jar as well under the target folder. Anyways thanks for the help.

Adam Grunt
  • 207
  • 1
  • 3
  • 16
0

This plug-in helps to create jar which i used previously.

        <!-- Make this jar executable -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
              <!-- DO NOT include log4j.properties file in your Jar -->
              <excludes>
                <exclude>**/log4j.properties</exclude>
              </excludes>
              <archive>
                <manifest>
                    <!-- Jar file entry point -->
                    <mainClass>com.project.app</mainClass>
                </manifest>
              </archive>
            </configuration>
        </plugin>

further please go throw below links for further understanding https://maven.apache.org/shared/maven-archiver/examples/classpath.html#Make

How can I create an executable JAR with dependencies using Maven?

Thank You

Community
  • 1
  • 1
murali selenium
  • 3,847
  • 2
  • 11
  • 20
0

The problem is based on the messages The POM for testng...is not valid that means either you have selected a wrong version (apart from that the given versions are very old) or you don't have access to either Maven central to download your dependencies or you have a proxy/firewall in there...Apart from that you have started tests which are starting a Chrome browser based on selenium which could take some time having started the browser or maybe have stuck based on other problems...

khmarbaise
  • 92,914
  • 28
  • 189
  • 235