I'm trying to run my testNg.xml file using jenkins. but the following error has occured.
Jenkins settings
I don't use any source code management method, so i kept it Non
Build Triggers settings has enabled "Build whenever a SNAPSHOT dependency is built"
Build
Root POM = C:\Users*******\AutomationProject\entution_6_26\pom.xml
Goals and options = clean test
under global tool configuration
JDK installation has set to Install automatically
Maven Configuration set as,
Default settings provider = settings file in file system
File path = C:\Users***.m2\settings.xml
Default global settings provider = Use default maven global settings
TestNg File
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Entution v1.1">
<test name="Purchase Order Form">
<classes>
<class name="Procurement._01_PurchaseOrder.TestCases.TestCase_13_Procurement_PurchaseOrder" />
</classes>
</test>
<test name="Inbound Shipment Form">
<classes>
<class name="Procurement._01_PurchaseOrder.TestCases.TestCase_13_Procurement_InboundShipment" />
</classes>
</test>
<test name="Purchase Invoice">
<classes>
<class name="Procurement._01_PurchaseOrder.TestCases.TestCase_13_Procurement_PurchaseInvoice" />
</classes>
</test>
</suite>
POM file
<?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>
<groupId>test11</groupId>
<artifactId>test11</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-core</artifactId>
<version>2.68</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>TestNgSuite.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
<!-- https://mvnrepository.com/artifact/org.jenkins-ci.main/jenkins-core -->
</project>
File hierarchy
I removed all the dependencies in the POM.xml file, that belong to the Jenkins.The problem solved...
Related
I know there are a lot of similar questions out there regarding this issue but none of them have helped me. I think it could be because of my relative skill level with maven and gwt, but I'd like to ask for help.
I am currently getting this error:
It goes on for every single class file listed in the com.server package that I have.
Below is the pjg.gwt.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
When updating your version of GWT, you should also update this DTD
reference,
so that your app can take advantage of the latest GWT module
capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.9.0//EN"
"https://www.gwtproject.org/doctype/2.9.0/gwt-module.dtd">
<module rename-to='com'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='com.client.pjg'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<source path='server'/>
<!-- allow Super Dev Mode -->
<add-linker name="xsiframe"/>
</module>
And here is my pom.xml:
<?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/maven-v4_0_0.xsd">
<!-- POM file generated with GWT webAppCreator -->
<modelVersion>4.0.0</modelVersion>
<groupId>com</groupId>
<artifactId>pjg</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>com.pjg</name>
<properties>
<!-- Setting maven.compiler.source to something different to 1.8
needs that you configure the sourceLevel in gwt-maven-plugin since
GWT compiler 2.8 requires 1.8 (see gwt-maven-plugin block below) -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- Don't let your Mac use a crazy non-standard encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencyManagement>
<dependencies>
<!-- ensure all GWT deps use the same version (unless overridden) -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>2.9.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.smartgwt/smartgwt -->
<dependency>
<groupId>com.smartgwt</groupId>
<artifactId>smartgwt</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
<build>
<!-- Output classes directly into the webapp, so that IDEs and "mvn process-
classes" update them in DevMode -->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-
INF/classes</outputDirectory>
<plugins>
<!-- GWT Maven Plugin-->
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-8</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<moduleName>com.pjg</moduleName>
<moduleShortName>pjg</moduleShortName>
<failOnError>true</failOnError>
<!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if you
use
a different source language for java compilation -->
<sourceLevel>1.8</sourceLevel>
<!-- Compiler configuration -->
<compilerArgs>
<!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
<arg>-compileReport</arg>
<arg>-XcompilerMetrics</arg>
</compilerArgs>
<!-- DevMode configuration -->
<warDir>${project.build.directory}/${project.build.finalName}</warDir>
<classpathScope>compile+runtime</classpathScope>
<!-- URL(s) that should be opened by DevMode (gwt:devmode). -->
<startupUrls>
<startupUrl>pjg.html</startupUrl>
</startupUrls>
</configuration>
</plugin>
<!-- Skip normal test execution, we use gwt:test instead -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
I believe there is just an issue with the declaration in either the pom or the gwt.xml file but I can't seem to figure it out. I have my declared source paths in the gwt.xml and I believe I have everything I need in the pom.xml. My only other thought is that there might be something mislabeled/titled? Really unsure at this point and figure another set of eyes would be a help.
Is there anything obvious I am missing?
Thanks in advance!
Your code is using the SmartGWT library, so it needs to be declared in your module (.gwt.xml) file, like so:
<inherits name='com.smartgwt.SmartGwt' />
You might to check the SmartGwt documentation for your version, to make sure that this is still the correct entry point.
I have gone through lot of articles and SO posts before posting this question. I have created 2 maven profiles, one for each environment. When I run my pom.xml through eclipse's Run As > Maven test, the tests are executed. But when I execute it through Run Configuration, for this purpose, I created a Run Configuration called "Test Project" which has maven goals set to "test" and profiles set to "staging", the execution is throwing
There was an error in the forked process
[ERROR] com/beust/jcommander/ParameterException : Unsupported major.minor version 52.0
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] com/beust/jcommander/ParameterException : Unsupported major.minor version 52.0
If it's a java version issue, then it shouldn't have executed when I executed Run As > Maven test.
Here's my pom.xml
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.sample</groupId>
<artifactId>TestProject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>TestProject</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>
<profile>
<id>staging</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>prod</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng2.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.uncommons/reportng -->
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.4</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
Both testng.xml and testng2.xml are similar except for the parameter value.
Here's my testng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite verbose="0" name="Test Project suite">
<parameter name="env" value="staging" />
<test name="Test Project sample tests">
<classes>
<class name="com.sample.TestProject.AppTest" />
</classes>
</test>
</suite>
Please add properties as shown below and then retry.
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
This would cause the JDK version required to be set to 1.8. If you don't provide this, then by default, Maven resorts to being 1.5 compliant.
When you running via the command line (by using mvn test), this would be required. The error is a re-iteration of this problem.
When you do a Run as > maven test I am guessing that the JDK that is provided by your IDE comes into effect (I dont have a way to technically confirm this theory).
For additional context, you can refer to this stackoverflow post as well.
I'm trying to build my test in jenkins with testng. So I configured a testng.xml file that can run my tests
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="TestRun">
<test name="TestRunFireFox">
<parameter name="browser" value="firefox"/>
<classes>
<class name="Data.Tests.TestRun" />
</classes>
</test>
</suite>
If I just run it local it will get the firefox browser without any problems. But if I try to build it threw jenkins it will give my following error
Exception org.testng.TestNGException
Message: Parameter 'browser' is required by #Configuration on method startup but has not been marked #Optional or defined
Stacktrace:
at org.testng.internal.Parameters.createParameters(Parameters.java:165)
at org.testng.internal.Parameters.createParameters(Parameters.java:372)
at org.testng.internal.Parameters.createConfigurationParameters(Parameters.java:90)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:199)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:140)
at org.testng.TestRunner.beforeRun(TestRunner.java:645)
at org.testng.TestRunner.run(TestRunner.java:613)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
at org.testng.SuiteRunner.run(SuiteRunner.java:259)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
at org.testng.TestNG.run(TestNG.java:1032)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:70)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:158)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:98)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
I think it has something to do with my parameters but I can't see what it is. This is also my pom file I think it's correctly configureted
<?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>
<groupId>intix</groupId>
<artifactId>automation</artifactId>
<version>1.1-SNAPSHOT</version>
<properties>
<testng.version>6.9.4</testng.version>
<selenium.version>2.46.0</selenium.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.52.0</version>
</dependency>
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.0</version>
</dependency>
</dependencies>
<build>
<defaultGoal>integration-test</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>TestRun.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Have you mentioned
#Parameters ({"browser"})
on your java test file? where are you accepting the browser parameter for your test?
The problem was if you run the class without the xml file of testng, he had a problem with the browser.
So to get it working you have to use
public void method(#Optional("firefox")){}
By doing this your parameter will always be filled even if you run the method without an testng xml file.
im trying to build an example code with maven liferay:build-service from an service.xml
There is simple entity company.
After code generating i have uncompilable code. I have tried another versions of maven plugins, but it didnt help.
Thanx
My pom.xml
<?xml version="1.0"?>
<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.example.plugins</groupId>
<artifactId>intlib-env</artifactId>
<packaging>war</packaging>
<name>intlib-env Portlet</name>
<version>1.0.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>com.liferay.maven.plugins</groupId>
<artifactId>liferay-maven-plugin</artifactId>
<version>6.1.2</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>build-css</goal>
</goals>
</execution>
</executions>
<configuration>
<autoDeployDir>D:\portal\liferay\deploy</autoDeployDir>
<appServerDeployDir>D:\portal\liferay\tomcat7\webapps</appServerDeployDir>
<appServerLibGlobalDir>D:\portal\liferay\tomcat7\lib\ext</appServerLibGlobalDir>
<appServerPortalDir>D:\portal\liferay\tomcat7\webapps\ROOT</appServerPortalDir>
<liferayVersion>6.1.2</liferayVersion>
<pluginType>portlet</pluginType>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<version>6.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-bridges</artifactId>
<version>6.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-taglib</artifactId>
<version>6.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-java</artifactId>
<version>6.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>Liferay-v6.x-Runtime-Stub</id>
<properties>
<liferay.version>6.1.2</liferay.version>
<liferay.maven.plugin.version>6.1.30.1</liferay.maven.plugin.version>
<liferay.auto.deploy.dir>D:\portal\liferay\deploy</liferay.auto.deploy.dir>
<liferay.app.server.deploy.dir>D:\portal\liferay\tomcat7\webapps</liferay.app.server.deploy.dir>
<liferay.app.server.lib.global.dir>D:\portal\liferay\tomcat7\lib\ext</liferay.app.server.lib.global.dir>
<liferay.app.server.portal.dir>D:\portal\liferay\tomcat7\webapps\ROOT</liferay.app.server.portal.dir>
</properties>
</profile>
</profiles>
</project>
and here the service.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">
<service-builder package-path="cz.sysnet.intlib.eia">
<author>EB</author>
<namespace>EIA</namespace>
<entity name="Company" local-service="true" remote-service="false">
<column name="Id" type="long" primary="true" />
<column name="ICO" type="String" />
<column name="name" type="String" />
<column name="companyId" type="long" />
<column name="groupId" type="long" />
<order by="asc">
<order-column name="name" />
</order>
<finder name="G_N" return-type="Collection">
<finder-column name="groupId" />
<finder-column name="name" />
</finder>
<finder name="GroupId" return-type="Collection">
<finder-column name="groupId" />
</finder>
<finder name="CompanyId" return-type="Collection">
<finder-column name="companyId" />
</finder>
</entity>
</service-builder>
Here are few of the errors after successfully generation of the code.
Description Resource Path Location Type
The method update(Company, boolean) in the type BasePersistence<Company> is not applicable for the arguments (Company) CompanyLocalServiceBaseImpl.java /intlib-env2/src/main/java/cz/sysnet/intlib/eia/service/base line 80 Java Problem
The method update(Company, boolean) in the type BasePersistence<Company> is not applicable for the arguments (Company) CompanyLocalServiceBaseImpl.java /intlib-env2/src/main/java/cz/sysnet/intlib/eia/service/base line 276 Java Problem
The method update(Company, boolean) in the type BasePersistence<Company> is not applicable for the arguments (Company) CompanyUtil.java /intlib-env2/src/main/java/cz/sysnet/intlib/eia/service/persistence line 89 Java Problem
The method update(Company, boolean) in the type BasePersistence<Company> is not applicable for the arguments (Company, ServiceContext) CompanyUtil.java /intlib-env2/src/main/java/cz/sysnet/intlib/eia/service/persistence line 97 Java Problem
The method setModelClass(Class<Company>) is undefined for the type CompanyPersistenceImpl CompanyPersistenceImpl.java /intlib-env2/src/main/java/cz/sysnet/intlib/eia/service/persistence line 169 Java Problem
The method setExpandoBridgeAttributes(ExpandoBridge) of type CompanyModel must override or implement a supertype method CompanyModel.java /intlib-env2/src/main/java/cz/sysnet/intlib/eia/model line 146 Java Problem
The method setExpandoBridgeAttributes(BaseModel<?>) of type CompanyModel must override or implement a supertype method CompanyModel.java /intlib-env2/src/main/java/cz/sysnet/intlib/eia/model line 143 Java Problem
The method countWithDynamicQuery(DynamicQuery) in the type BasePersistence<Company> is not applicable for the arguments (DynamicQuery, Projection) CompanyLocalServiceBaseImpl.java /intlib-env2/src/main/java/cz/sysnet/intlib/eia/service/base line 210 Java Problem
Thanx.
Company is a type that Liferay also has. Most likely ServiceBuilder generates import for Liferay's Company class, clashing with your own. Unless you want to start over, you'd have some tasks to do to get rid of all of your company declarations from the generated content of service builder - hibernate files, spring configuration and others. Search for cz.sysnet.intlib.eia.Company in your project and remove those declarations (and the Company* classes in your project), rename your entity (e.g. to Kompany, choose any other value that you like) and rebuild the services.
ServiceBuilder has a few limitations like these, after all, it's a code generator and rarely used to introduce another entity with an already existing name. You might want to add this limitation to LPS-27710 and watch that issue. It probably doesn't have the highest priority unless there's a lot of activity on there
Thanx for the response,
i had to move from the newest version apache maven 3.2.2 to the 3.1.1 and cleaned the maven files in the project.
Now its working again.
I'm pretty new to maven and I want to run my test classes using maven. I have generated the testng.xml and I have created the POM.xml file also. But when you run the mvn install, it generates this error :
[package org.testng.annotations does not exist]
please advice on this.
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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.TestNG</groupId>
<artifactId>TestNG</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
testng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" verbose="1" preserve-order="true">
<test name="Test">
<packages>
<package name="com.testngTest2" />
<package name="com.testngTest" />
</packages>
</test> <!-- Test -->
</suite> <!-- Suite -->
I've got similar problem. The reason for that was "Scope" option of "testng" dependency set to "test" when "compile" was needed.
How I fixed it (note, I used Eclipse):
Open pom.xml file.
Go to "Dependencies" tab.
Select "testng" package and click on "Properties..."
On opened screen change "Scope" option to "compile" and click "OK" to save it.
Try to build your project again with "compile test" goals.
remove test scope testng dependency and add compile
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
<scope>compile</scope>
</dependency>
In your pom.xml file you have scope of testng as test
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.13.6</version>
<scope>test</scope>
</dependency>
Replace the scope by compile
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.13.6</version>
<scope>compile</scope>
</dependency>
Beleive me below wil work replace "test" to "compile" in scope
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.13.6</version>
<scope>compile</scope>
</dependency>
Even I had faced this issue and got a solution for the same.
In your pom.xml file remove the scope and this should work fine.
As per below code in pom.xml, remove the scope tag.
Even though we have imported the maven dependency for Testng, when you add scope tag in XML file, it treats as JUnit annotation and not as Testng. So when I removed scope tag, My #Test Annotation was treated as Testng Annotation.
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.7</version>
**<scope>test</scope>** //Remove this line and compile maven
</dependency>
test to compile -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.8</version>
<scope>compile</scope>
</dependency>
Make sure your tests are in "src/test/java".
It will solve this problem
Set testng's scope to "provided" if you're building a web app and don't want it included in WEB-INF/lib.
Below solution works for me-
Please add below dependencies in your pom.xml
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>17.0</version>
</dependency>
For JetBrains IntelliJ users who can't find pom.xml file:
go to 'file' > 'project structure'
select module where test package is located from 'project settings' > 'modules'
go to dependencies tab
change scope setting from 'test' to 'compile'