Showing posts with label Maven. Show all posts
Showing posts with label Maven. Show all posts

Wednesday, 16 November 2011

How to change MANIFEST.MF generated by maven?

You have to add plugin configuration in pom.xml in section build/plugins:
Here is an example of configuring default class run when executing generated jar:
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
     <archive>
      <manifest>
       <mainClass>package.Class</mainClass>
      </manifest>
     </archive>
    </configuration>
   </plugin>
Here is an example of using already generated MANIFEST.MF file as the manifest file of the jar:
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
     <archive>
      <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
     </archive>
    </configuration>
   </plugin>

More info about plugin parameters on: http://maven.apache.org/maven-1.x/plugins/jar/manifest.html

Tuesday, 15 November 2011

Runing ChromeDriver on Linux

I decided to use WebDriver in my project. It is a next version of Selenium library used for tests. I am using Ubuntu system. In my pom.xml I needed only to add one dependency:

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

I have created a simple java code in my main method:

 WebDriver driver = new ChromeDriver();
 driver.get("http://google.pl");
 driver.findElement(By.name("q")).sendKeys("Selenium");
 driver.findElement(By.name("q")).submit();

My program did not manage to connect to Chrome web browser. I needed to download chromedriver from http://code.google.com/p/chromium/downloads/list and add a system property webdriver.chrome.driver with path to this file.

It did work!

Friday, 28 October 2011

Dependency tree in maven

To see dependency tree in maven use command:
mvn dependency:tree

Sunday, 2 October 2011

Cloud Foundry Deployments with Maven

The Cloud Foundry team has released the Cloud Foundry Maven Plugin. Developers can now easily integrate cloud deployments into their Maven projects. For more details go to: http://blog.springsource.com/2011/09/22/rapid-cloud-foundry-deployments-with-maven/