我使用Maven項目(V3.1.1),我使用的硒自動化。我已經在Jenkins(localhost)中託管了我的項目,並試圖從Jenkins本身編譯該項目。無法編譯Maven項目
com.eh.base
com.eh.pageobjects
com.eh.tests
[我沒有使用像結構的src \主\資源]
在詹金斯的Maven插件將實現編譯過程。我試過用Maven插件2.2.1以及3.1.1用編譯的目標,它沒有工作。爲了在日食級別內複製它。我嘗試使用命令MVN清潔編譯從命令提示符Maven項目,MVN編譯。
構建結果:
D:\Shaw\Shaw\Projects\Branch\MyProject>mvn compile
[INFO] Scanning for projects...
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ MyProject ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\Shaw\Shaw\Projects\Branch\MyProject\src\main\resources
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ MyProject ---
[INFO] No sources to compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.352s
[INFO] Finished at: Thu Feb 13 01:36:23 IST 2014
[INFO] Final Memory: 10M/108M
[INFO] ------------------------------------------------------------------------
由此,我希望它會編譯生成的/目標/班類文件。但是這並沒有這樣做。由於我使用我的項目的自定義包,我想我應該嘗試maven原型。請指教。
請讓我知道如果我錯過了什麼。
POM文件:
<?xml version="1.0" encoding="UTF-8"?>
<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>
<artifactId>MyProject</artifactId>
<groupId>com.eh</groupId>
<version>1.0</version>
<packaging>jar</packaging>
<name>MyProject</name>
<description>A sample Maven project that demonstrates how to integrate Sauce OnDemand with WebDriver tests that run using JUnit
</description>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-xml</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jlibs-xml.jar</systemPath>
</dependency>
<dependency>
<groupId>BaseLibrary</groupId>
<artifactId>BaseLibrary</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/BaseLibrary.jar</systemPath>
</dependency>
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-examples</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jlibs-examples.jar</systemPath>
</dependency>
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-greplog</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jlibs-greplog.jar</systemPath>
</dependency>
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-jdbc</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jlibs-jdbc.jar</systemPath>
</dependency>
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-nblr</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jlibs-nblr.jar</systemPath>
</dependency>
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-nbp</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jlibs-nbp.jar</systemPath>
</dependency>
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-swing</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jlibs-swing.jar</systemPath>
</dependency>
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-wadl</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jlibs-wadl.jar</systemPath>
</dependency>
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-xmldog</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jlibs-xmldog.jar</systemPath>
</dependency>
<dependency>
<groupId>TestNGFileGenerator</groupId>
<artifactId>TestNGFileGenerator</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/TestNGFileGenerator.jar</systemPath>
</dependency>
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-core</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jlibs-core.jar</systemPath>
</dependency>
<dependency>
<groupId>SauceREST</groupId>
<artifactId>SauceREST</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/SauceREST.jar</systemPath>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.33.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.3</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.8</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.7.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
:
<property>
<name>org.uncommons.reportng.escape-output</name>
<value>false</value>
</property>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter</value>
</property>
</properties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.14</version>
<configuration>
<showSuccess>false</showSuccess>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<!-- put your configurations here -->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>test</phase>
<configuration>
<tasks>
<zip destfile="${project.basedir}/target/surefire-reports/reports.zip"
basedir="${project.basedir}/target/surefire-reports/"
includes="**/*.html,**/*.xml,**/*.css"
/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>sauce-eh</id>
<name>sauce_quickstart</name>
<url>file://${project.basedir}/lib</url>
</repository>
<repository>
<id>java-net</id>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>saucelabs-repository</id>
<url>https://repository-saucelabs.forge.cloudbees.com/release</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>
顯示您的文件?你在哪裏找到你喜歡編譯的源文件? 'src/main/java'或者在測試的情況下,我會假設'src/test/java'。 – khmarbaise
嗨@khmarbaise,我在原帖中添加了我的pom.xml文件。我的源文件是/ src目錄/ COM/EH /測試,/ src目錄/ COM/EH /基地,/ src目錄/ COM/EH/pageobjects – JavaLover