How to create the jars using maven pom.xml?

39 views
Skip to first unread message

syam

unread,
Nov 20, 2015, 7:57:03 AM11/20/15
to Selenium Users
Hi All,

I have to create the jars for my selenium maven project, so please can any one send the pom.xml code.

My project structure:

src/main/java
scr/test/java
lib with few jars ( which are not there in pom.xml as dependencies).

Krishnan mahadevan

unread,
Nov 20, 2015, 8:00:55 AM11/20/15
to seleniu...@googlegroups.com
Not really a selenium related query but more of a maven question.

Try searching for one of the following :

* maven assembly plugin
* maven shade plugin

The documentation for both the above plugins contains samples and should get you started.

-Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else"

From: syam
Sent: ‎20-‎11-‎2015 18:28
To: Selenium Users
Subject: [selenium-users] How to create the jars using maven pom.xml?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/60c6a23a-38e5-4dbd-a3f8-bac34fa660e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bharat Pottipareddy

unread,
Nov 20, 2015, 10:30:57 AM11/20/15
to seleniu...@googlegroups.com
Following code might help you - 
 <plugin>
                                         <groupId>org.apache.maven.plugins</groupId>
                                         <artifactId>maven-assembly-plugin</artifactId>
                                         <version>2.4.1</version>
                                         <configuration>
                                                <!-- get all project dependencies -->
                                                <descriptorRefs>
                                                       <descriptorRef>jar-with-dependencies</descriptorRef>
                                                </descriptorRefs>

                                         </configuration>
                                         <executions>
                                                <execution>
                                                       <id>make-assembly</id>
                                                       <!-- bind to the packaging phase -->
                                                       <phase>package</phase>
                                                       <goals>
                                                              <goal>single</goal>
                                                       </goals>
                                                </execution>
                                         </executions>
                                  </plugin>


After adding to the POM, run from cmd line : mvn clean install package

this will generate jar 

--
Reply all
Reply to author
Forward
0 new messages