I am trying to build the samples which are meant for WSO2 Identiy Server. I am following the steps listed in :
https://docs.wso2.com/display/IS500/Configuring+Single+Sign-On+with+SAML+2.0
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] 'groupId' is missing. # line 4, column 109
#
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountere
d while processing the POMs:
[FATAL] 'groupId' is missing. # line 4, column 109
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu
ilder.java:422)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGra
phBuilder.java:419)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor
(DefaultGraphBuilder.java:410)
at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.
java:83)
at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
[ERROR]
[ERROR] The project [unknown-group-id]:org.wso2.sample.is.sso.agent:1.2.0 (C:\
codes\wso\sso\SSOAgentSample\pom.xml) has 1 error
[ERROR] 'groupId' is missing. # line 4, column 109
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
gException
My pom.xml is same as listed in the link. Any help will be highly appreciated.
Please follow the 2nd step given in the example. Then it should work.
Remove the parent entry in the pom.xml file that comes along with the sample. The contents of the pom.xml file will look similar to the following once you remove the parent entry. Alternatively, replace the contents of the pom.xml file with the following code snippet.
<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">
<groupId>org.wso2.identity</groupId>
<version>5.0.0</version>
<modelVersion>4.0.0</modelVersion>
<artifactId>wso2is-identity-samples-sso</artifactId>
<packaging>pom</packaging>
<name>Identity Server : SSO Samples</name>
<modules>
<module>SSOAgentSample</module>
</modules>
</project>
Related
I am a beginner in wso2cep. I want to execute the first sample of WSO2 CEP documentation. I use windows10 as operating system. I type the following command but i getting following exeption in Console output:
c:\wso2cep-4.0.0\samples\producers\http>ant Durl=http://localhost:9763/endpoints/httpReceiver -Dsn=0001
Buildfile: c:\wso2cep-4.0.0\samples\producers\http\build.xml
init:
compile:
[javac] c:\wso2cep-4.0.0\samples\producers\http\build.xml:71: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to
false
for repeatable builds
[copy] Copying 1 file to c:\wso2cep-4.0.0\samples\producers\http\temp\classes
run:
[echo] Configure -Durl=xxxx and ( -DfilePath=xxxx or -Dsn='sample number')
optionally use -Dusername=xxxx -Dpassword=xxxx
[java] [main] INFO org.wso2.carbon.sample.http.Http - Starting WSO2 Http
Client
[java] Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:4
[java] at org.wso2.carbon.sample.http.Http.main(Unknown Source)
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 3 seconds
I add this line: <property name="filePath" value=""""/> to the build.xml file but I still get above exception. My build.xml file become as following:
<property name="carbon.home" value="${basedir}"/>
<property name="lib" value="${carbon.home}/repository/lib"/>
<property name="tempdir" value="${carbon.home}/tmp/setup"/>
<property name="output.dir" value="${carbon.home}/tmp/wso2"/>
<property name="filePath" value=""""/>
Should i change "filePath" to another thing? Should i add this line to build.xml file or change other lines? Please help and explain to me.
I am completely new to camel and jboss fuse and I am facing one problem. I am trying to send a request to my webservice using soapUI.I have used cxf component of apache camel and jaxb in apache camel. In the request there is a tag AuthTimeStamp.
When I am entering
<AuthTimestamp>2009-01-02T11:13:56.745+05:30 </AuthTimestamp>
it is working fine. But when I am entering:
<AuthTimestamp>3-23-190017:00</AuthTimestamp>
it is giving me error. I believe jaxb is doing some kind of validation and my request is failing there. But I don't to return soap fault type error.
I want a proper xml to be returned with proper information. If the request passes to my cxf bean then I can handle the exception make a proper error packet and return it. Similar questions have been asked before but I was not able to find appropriate solution.
Initial part of my camel route:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<!-- Service for gateway is exposed. cxfEndpoint mentioned in EsangamBeanConfig.xml-->
<!-- <to uri="bean:NSDGPortTypeImpl"/> -->
<!-- <simple>${body.getIISMessage()}</simple> -->
<!-- <to uri="bean:iISMessageProcessorID?method=logTransaction(${body})"/>
-->
<!--Here goes IISMessageContext(body) -->
<!--Here goes SubmitDocument(body) -->
<!--Here goes IISMessageContext(body) -->
<camelContext id="eSangamMessagingCamelContext" xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<jaxb contextPath="in.gov.esangam.eservices.messaging" prettyPrint="true" encoding="UTF-8" id="myJaxb"/>
</dataFormats>
<route id="eSangam Messaging Start">
<from uri="cxf:bean:NSDGPortType"/>
<log message="New Request Arrived at Gateway"/>
Below is the stack trace:
14:47:31,842 | WARN | qtp1545452967-60 | PhaseInterceptorChain | 118 - org.apache.cxf.cxf-core - 3.0.4.redhat-620133 | Interceptor for {http://www.mit.gov.in/eGov/schema/NSDG/wsdl}NSDGPortTypeService#{http://www.mit.gov.in/eGov/schema/NSDG/wsdl}processSubmitDocument has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unmarshalling Error: 3/23/19005:00:00PM
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:908)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:712)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:176)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:194)[131:org.apache.cxf.cxf-rt-wsdl:3.0.4.redhat-620133]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)[118:org.apache.cxf.cxf-core:3.0.4.redhat-620133]
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[118:org.apache.cxf.cxf-core:3.0.4.redhat-620133]
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)[89:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0.0]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)[123:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-620133]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[101:org.ops4j.pax.web.pax-web-jetty:3.2.3]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)[101:org.ops4j.pax.web.pax-web-jetty:3.2.3]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)[101:org.ops4j.pax.web.pax-web-jetty:3.2.3]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.Server.handle(Server.java:370)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_91]
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:
[javax.xml.bind.UnmarshalException: 3/23/19005:00:00PM
- with linked exception:
[java.lang.IllegalArgumentException: 3/23/19005:00:00PM]]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:483)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:417)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:394)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:858)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
at org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:102)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
at org.apache.cxf.jaxb.JAXBEncoderDecoder$2.run(JAXBEncoderDecoder.java:897)
at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_91]
at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:895)[132:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-620133]
... 40 more
Caused by: javax.xml.bind.UnmarshalException: 3/23/19005:00:00PM
- with linked exception:
[java.lang.IllegalArgumentException: 3/23/19005:00:00PM]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:740)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleError(UnmarshallingContext.java:770)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleError(UnmarshallingContext.java:766)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.handleParseConversionException(Loader.java:275)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:69)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(UnmarshallingContext.java:589)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.processText(StAXStreamConnector.java:338)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElement(StAXStreamConnector.java:216)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:185)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:415)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
... 46 more
Caused by: javax.xml.bind.UnmarshalException: 3/23/19005:00:00PM
- with linked exception:
[java.lang.IllegalArgumentException: 3/23/19005:00:00PM]
... 56 more
Caused by: java.lang.IllegalArgumentException: 3/23/19005:00:00PM
at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl$Parser.parseYear(Unknown Source)[:]
at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl$Parser.parse(Unknown Source)[:]
at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl.<init>(Unknown Source)[:]
at org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl.newXMLGregorianCalendar(Unknown Source)[:]
at com.sun.xml.bind.DatatypeConverterImpl._parseDateTime(DatatypeConverterImpl.java:378)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$2.parse(RuntimeBuiltinLeafInfoImpl.java:279)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$2.parse(RuntimeBuiltinLeafInfoImpl.java:277)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.FilterTransducer.parse(FilterTransducer.java:84)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.parse(TransducedAccessor.java:245)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:65)[113:org.apache.servicemix.bundles.jaxb-impl:2.2.11.1]
... 51 more
14:47:31,846 | INFO | qtp1545452967-60 | Soap12FaultOutInterceptor | 134 - org.apache.cxf.cxf-rt-bindings-soap - 3.0.4.redhat-620133 | class org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor$Soap12FaultOutInterceptorInternalapplication/soap+xml
Trying to see unit test code coverage on sonar. I am using Jacoco code coverage and able to get the code coverage for my project when I execute my code in eclipse. However while running in Jenkins, I get following messages and warnings as NO Tests to run , No Sources to compile
I can the some code coverage report on sonar but for unit tests it shows. How can Sonar display the coverage for unit tests? Also how can I eliminate the warning messages?
Attaching my surefire and jacoco plugins and jebnkins console log
Kindly help
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.4.201312101107</version>
<executions>
<execution>
<id>prepare-unit-test-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>generate-unit-test-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.12.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-testng</artifactId>
<version>2.12.4</version>
</dependency>
</dependencies>
<configuration>
<systemPropertyVariables>
<environment>${env.USER}</environment>
</systemPropertyVariables>
</configuration>
</plugin>
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Project Test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # project test ---
[INFO] Deleting /Users/ray1/.jenkins/jobs/try10-aprl13/workspace/target
[INFO]
[INFO] --- jacoco-maven-plugin:0.6.4.201312101107:prepare-agent (prepare-unit-test-agent) # project test ---
[INFO] argLine set to -javaagent:/Users/ray1/.m2/repository/org/jacoco/org.jacoco.agent/0.6.4.201312101107/org.jacoco.agent-0.6.4.201312101107-runtime.jar=destfile=/Users/ray1/.jenkins/jobs/try10-aprl13/workspace/target/jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # project test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/ray1/.jenkins/jobs/try10-aprl13/workspace/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # project test---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # project test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/ray1/.jenkins/jobs/try10-aprl13/workspace/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # project test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # project test ---
[INFO] No tests to run.
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (run-unit-tests) # project test ---
[INFO] No tests to run.
[INFO] Skipping execution of surefire because it has already been run for this configuration
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # project test ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /Users/ray1/.jenkins/jobs/try10-aprl13/workspace/target/project test-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- jacoco-maven-plugin:0.6.4.201312101107:report (generate-unit-test-report) # project test ---
[INFO] Skipping JaCoCo execution due to missing execution data file
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # project test ---
[INFO] Installing /Users/ray1/.jenkins/jobs/try10-aprl13/workspace/target/project test-0.0.1-SNAPSHOT.jar to /Users/ray1/.m2/repository/com/company/taf/project test/0.0.1-SNAPSHOT/project test-0.0.1-SNAPSHOT.jar
[INFO] Installing /Users/ray1/.jenkins/jobs/try10-aprl13/workspace/pom.xml to /Users/ray1/.m2/repository/com/company/taf/project test/0.0.1-SNAPSHOT/project test-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.801 s
[INFO] Finished at: 2015-04-14T10:25:50-07:00
[INFO] Final Memory: 15M/81M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /Users/ray1/.jenkins/jobs/try10-aprl13/workspace/pom.xml to com.company.inner/project test /0.0.1-SNAPSHOT/project test-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /Users/ray1/.jenkins/jobs/try10-aprl13/workspace/target/project test-0.0.1-SNAPSHOT.jar to com.company.inner/project test /0.0.1-SNAPSHOT/project test-0.0.1-SNAPSHOT.jar
channel stopped
Finished: SUCCESS
you need to add this section to your parent pom.xml
<properties>
<!-- Properties to make sure we capture *all* coverage -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.language>java</sonar.language>
<sonar.jacoco.reportPath>${project.basedir}/../target/jacoco.exec</sonar.jacoco.reportPath>
</properties>
I had the similar issue, 0.0% coverage & no unit tests count on Sonar dashboard with SonarQube 6.7.2:
Maven : 3.5.2,
Java : 1.8,
Jacoco : Worked with 7.0/7.9/8.0,
OS : Windows
After a lot of struggle finding for correct solution, resolved issue with this configuration my parent pom looks like:
<properties>
<!--Sonar -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPath>${project.basedir}/../target/jacoco.exec</sonar.jacoco.reportPath>
<sonar.language>java</sonar.language>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.4.0.905</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<configuration>
<destFile>${sonar.jacoco.reportPath}</destFile>
<append>true</append>
</configuration>
<executions>
<execution>
<id>agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
I've tried few other options like jacoco-aggregate & even creating a sub-module by including that in parent pom but nothing really worked & this is simple. I see in logs <sonar.jacoco.reportPath> is deprecated,but still works as is and seems like auto replaced on execution or can be manually updated to <sonar.jacoco.reportPaths> or latest. Once after doing setup start with mvn clean install then mvn org.jacoco:jacoco-maven-plugin:prepare-agent install & then do mvn sonar:sonar , this is what I've tried please let me know if some other best possible solution available.Hope this helps!! If not please post your question..
I created a new scala project with the following:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:generate
-DarchetypeGroupId=org.scala-tools.archetypes
-DarchetypeArtifactId=scala-archetype-simple
-DarchetypeVersion=1.3
-DgroupId=myGroup
-DartifactId=myProject
-Dversion=0.1.0
-DinteractiveMode=false
Which gives me the following POM:
<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>myGroup</groupId>
<artifactId>myProject</artifactId>
<version>0.1.0</version>
<name>${project.artifactId}</name>
<description>My wonderfull scala app</description>
<inceptionYear>2010</inceptionYear>
<licenses>
<license>
<name>My License</name>
<url>http://....</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.version>2.8.0</scala.version>
</properties>
<!--
<repositories>
<repository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>
-->
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scala-tools.testing</groupId>
<artifactId>specs_${scala.version}</artifactId>
<version>1.6.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<configuration>
<args>
<arg>-make:transitive</arg>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<useFile>false</useFile>
<disableXmlReport>true</disableXmlReport>
<!-- If you have classpath issue like NoDefClassError,... -->
<!-- useManifestOnlyJar>false</useManifestOnlyJar -->
<includes>
<include>**/*Test.*</include>
<include>**/*Suite.*</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
I can run mvn test and the sample tests run successfully. I'd like to use the most recent version of scala (I downloaded / installed 2.9.2...), but the most recent version of the org.scala-tools.testing scala_VERSION dependency seems to be 2.9.1. I made the following changes in my POM:
<scala.version>2.9.1</scala.version>
and
<dependency>
<groupId>org.scala-tools.testing</groupId>
<artifactId>specs_${scala.version}</artifactId>
<version>1.6.5</version>
<scope>test</scope>
</dependency>
Now, running mvn test gives
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running samples.ListSuite
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.674 sec <<< FAILURE!
initializationError(samples.ListSuite) Time elapsed: 0.003 sec <<< ERROR!
java.lang.ClassCastException: scala.collection.immutable.Set$EmptySet$ cannot be
cast to scala.collection.generic.Addable
at org.scalatest.FunSuite$class.test(FunSuite.scala:1039)
at samples.ListSuite.test(scalatest.scala:59)
at samples.ListSuite.<init>(scalatest.scala:61)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at org.scalatest.junit.JUnitRunner.<init>(JUnitRunner.scala:62)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:51)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:120)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:103)
at org.apache.maven.surefire.Surefire.run(Surefire.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Running samples.StackSuite
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.12 sec
Running samples.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Results :
Tests in error:
initializationError(samples.ListSuite)
Tests run: 4, Failures: 0, Errors: 1, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.880s
[INFO] Finished at: Wed Oct 10 01:10:56 ADT 2012
[INFO] Final Memory: 9M/112M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.6:test (default-test) on project myProject: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Dropbox\work\dev\scalasandbox\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I presumably have some of the most simple tests possible (samples created by the maven archetype plugin), and bumping scala by a single minor version is breaking them? Should I just stick with scala 2.8 until the maven tools catch up?
Your artifact is outdated.
The latest version of Scala is 2.10. Currently ScalaTest is being distributed under different groupid and it supports the latest version of Scala. Here's the dependecy:
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<version>2.0.M5b</version>
<scope>test</scope>
</dependency>
You will also require a different plugin:
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
You don't need to specify any repositories, since all those artifacts are being distributed with the central repo.
Here's an example of a complete pom of a project depending on the Scala 2.10.
Use specs_2.9.1:1.6.9
And latest version of plugin
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
Old scala maven plugin in not longer supported.
Hi i have the following configuration.
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.3.v20120416</version>
</plugin>
and in my jetty-env.xml I have
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
</Configure>
When i run with mvn jetty:run i get the following error.
Caused by: java.lang.ClassNotFoundException: org.mortbay.jetty.webapp.WebAppCont
ext
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.eclipse.jetty.util.Loader.loadClass(Loader.java:92)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClas
s(XmlConfiguration.java:349)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configur
e(XmlConfiguration.java:314)
at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.jav
a:279)
at org.mortbay.jetty.plugin.AbstractJettyMojo.applyJettyXml(AbstractJett
yMojo.java:449)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMo
jo.java:467)
How do i fix this?
I suspect you have a jetty-web.xml or some old jetty configuration files floating around
org.mortbay.jetty.webapp.WebAppContext = org.eclipse.jetty.webapp.WebAppContext
the packaging is different in jetty7 and 8 since we moved to the eclipse foundation a few years ago.
http://wiki.eclipse.org/Jetty/Starting/Porting_to_Jetty_7