I am facing the below error while I am importing a plugin to the eclipse, using the existing Maven Project option.
ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.7:assembly (install-kar) on project eric-gui-aggregator: Unable to build assembly: Uses constraint violation. Unable to resolve resource org.apache.servicemix.bundles.okhttp [org.apache.servicemix.bundles.okhttp/3.12.1.1] because it is exposed to package 'javax.annotation' from resources system.bundle [system.bundle/0.0.0] and org.jsr-305 [org.jsr-305/3.0.2] via two dependency chains.
[ERROR]
[ERROR] Chain 1:
[ERROR] org.apache.servicemix.bundles.okhttp [org.apache.servicemix.bundles.okhttp/3.12.1.1]
[ERROR] import: (osgi.wiring.package=javax.annotation)
[ERROR] |
[ERROR] export: osgi.wiring.package: javax.annotation
[ERROR] system.bundle [system.bundle/0.0.0]
[ERROR]
[ERROR] Chain 2:
[ERROR] org.apache.servicemix.bundles.okhttp [org.apache.servicemix.bundles.okhttp/3.12.1.1]
[ERROR] import: (osgi.wiring.package=javax.annotation.meta)
[ERROR] |
[ERROR] export: osgi.wiring.package: javax.annotation.meta; uses:=javax.annotation
[ERROR] export: osgi.wiring.package=javax.annotation
[ERROR] org.jsr-305 [org.jsr-305/3.0.2]
I tried to exclude com.google.code.findbugs:jsr305 using the below tag but still I am getting the same build error.
<artifactSet>
<excludes>
<exclude>com.google.code.findbugs:jsr305</exclude>
</excludes>
</artifactSet>
We are using Java 11 in our project.
Related
I´m trying to set up the OpenCMIS InMemory Repository following the instructions from Apache but I keep getting the following error when running the Maven command mvn clean install -Dmaven.test.skip=true.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project chemistry-opencmis-client-bindings: Compilation failure
[ERROR] /home/openkm/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/ClientVersion.java:[29,16] error: cannot find symbol
[ERROR] symbol: method getDefinedPackage(String)
[ERROR] location: class ClassLoader
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :chemistry-opencmis-client-bindings
The OpenCMIS Server Development Guide (2nd Edition) PDF's last technical update is from 2014 and the POM of the sample project contains:
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<target>1.7</target>
<source>1.7</source>
That's utterly outdated and is surely not going to work with more recent JDKs.
Problem
We are trying to consume a Maven components in a private Maven repository... The dependency right now is not being pulled for some reason... I have declared the dependency in gradle as follows:
dependencies {
implementation group: 'super_.platform.client', name: 'client-feign', version: '1.0.0-SNAPSHOT'
}
repositories {
maven {
url "https://gitlab.com/api/v4/projects/22268428/packages/maven"
}
}
When running gradle eclipse to pull the dependency, the command fails with the following:
[INFO] Resolving super_.platform.client:client-feign:jar:1.0.0-SNAPSHOT with transitive dependencies
[WARNING] Missing POM for super_.platform.client:client-feign:jar:1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:07 min
[INFO] Finished at: 2020-11-06T19:49:27Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:get (default-cli) on project standalone-pom: Couldn't download artifact: Missing:
[ERROR] ----------
[ERROR] 1) super_.platform.client:client-feign:jar:1.0.0-SNAPSHOT
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=super_.platform.client -DartifactId=client-feign -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) org.apache.maven.plugins:maven-downloader-plugin:jar:1.0
[ERROR] 2) super_.platform.client:client-feign:jar:1.0.0-SNAPSHOT
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR] org.apache.maven.plugins:maven-downloader-plugin:jar:1.0
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR]
[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/MojoExecutionException
Question
Since the Git repo at Gitlab is private, I would imagine the Maven repository is also private. How to download that in Gradle?
Solution
Add the token information in the Maven repo passing the value through Environment Variable: GITLAB_TOKEN. You need to use the credentials section with an HTTP Header object.
maven {
url "https://gitlab.com/api/v4/projects/22268428/packages/maven"
credentials(HttpHeaderCredentials) {
name "Private-Token"
value System.env.GITLAB_TOKEN
}
authentication {
header(HttpHeaderAuthentication)
}
}
After that, I was able to pull the library from the private Maven repository within the Gitlab repo.
GITLAB_TOKEN=1234556 gradle eclipse
I downloaded the latest version of apache hadoop from the github repo and followed the steps here:
http://cleverowl.uk/2015/06/30/compiling-2-7-0-on-64-bit-linux/
I didn't install protobuf and java because I already have them installed on my machine.
When installing with the command:
mvn package -Pdist,native -DskipTests -Dtar
The following error appears:
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/felix/maven-bundle-plugin/2.5.0/maven-bundle-plugin-2.5.0.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.5.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin:jar:2.5.0 #
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.apache.hadoop:hadoop-main:3.0.2 (/home/andrew/hadoop-rel-release-3.0.2/pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.5.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin:jar:2.5.0: Could not transfer artifact org.apache.felix:maven-bundle-plugin:pom:2.5.0 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException
Any help?
i have a x-module with those properties:
module-name: x-datamodel
this is a part of the pom.xml
<groupId>com.x.datamodel</groupId>
<artifactId>x</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
i have install the project in a local repository with this command line:
mvn install:install-file -Dfile=/Users/me/Documents/Projects/x-datamodel/target/classes/x-datamodel.jar -DgroupId=com.x.datamodel -DgeneratePom=true -DlocalRepositoryPath=/Users/me/Documents/Projects/me-repository -DcreateChecksum=true -DartifactId=x -Dversion={1.0} -Dpackaging=jar
and added the project in bitbucket.
I try to integrate the module x in another project y.
here a part of the y's pom.xml
<dependency>
<groupId>com.x.datamodel</groupId>
<artifactId>x</artifactId>
<version>${x.version}</version>
</dependency>
<repositories>
<repository>
<id>me-repository</id>
<url>https://bitbucket.org/me/me-repository/src/master</url>
</repository>
</repositories>
i can import some classes of the module x in the project y, but when i build the y project i get this error:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/serviceImpl/UserServiceImpl.java:[3,32] package com.x.datamodel.model does not exist
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/serviceImpl/UserServiceImpl.java:[18,12] cannot find symbol
symbol: class User
location: class com.y.server.serviceImpl.UserServiceImpl
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/security/CustomUserDetailsService.java:[3,32] package com.x.datamodel.model does not exist
[INFO] 16 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:56 min
[INFO] Finished at: 2016-12-28T15:51:05+01:00
[INFO] Final Memory: 29M/209M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project y: Compilation failure: Compilation failure:
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file
[ERROR] error reading /Users/me/.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar; error in opening zip file
[ERROR] /Users/me/Documents/Projects/y/src/main/java/com/y/server/serviceImpl/UserServiceImpl.java:[3,32] package com.x.datamodel.model does not exist
[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
after installing the repository i have the library into this path:
.m2/repository/com/x/datamodel/x/1.0/x-1.0.jar
why not:
.m2/repository/com/x-datamodel/x/1.0/x-1.0.jar
I tend to think the file is corrupted. Try deleting it and downloading it again.
Try removing the below lines
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
With :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
I'm trying to use the Cobertura maven plugin for code coverage. But I am getting an error when running the following command:
mvn clean package cobertura:cobertura -Dcobertura.report.format=xml
Here is how I have the plugin defined in my pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<formats>
<format>xml</format>
</formats>
<instrumentation>
<excludes>
<include>**/*.class</include>
<exclude>**/*Test.class</exclude>
<exclude>**/Test*.class</exclude>
</excludes>
</instrumentation>
</configuration>
</plugin>
And here is the error I am receiving:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:09.201s
[INFO] Finished at: Thu Aug 21 17:28:24 GMT+00:00 2014
[INFO] Final Memory: 25M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.6:instrument (default-cli) on project project-beta: Execution default-cli of goal org.codehaus.mojo:cobertura-maven-plugin:2.6:instrument failed: A required class was missing while executing org.codehaus.mojo:cobertura-maven-plugin:2.6:instrument: net/sourceforge/cobertura/util/CommandLineBuilder
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:cobertura-maven-plugin:2.6
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/data/home/user/.m2/repository/org/codehaus/mojo/cobertura-maven-plugin/2.6/cobertura-maven-plugin-2.6.jar
[ERROR] urls[1] = file:/data/home/user/.m2/repository/net/sourceforge/cobertura/cobertura/2.0.3/cobertura-2.0.3.jar
[ERROR] urls[2] = file:/data/home/user/.m2/repository/org/ow2/asm/asm/4.1/asm-4.1.jar
[ERROR] urls[3] = file:/data/home/user/.m2/repository/org/ow2/asm/asm-tree/4.1/asm-tree-4.1.jar
[ERROR] urls[4] = file:/data/home/user/.m2/repository/org/ow2/asm/asm-commons/4.1/asm-commons-4.1.jar
[ERROR] urls[5] = file:/data/home/user/.m2/repository/org/ow2/asm/asm-util/4.1/asm-util-4.1.jar
[ERROR] urls[6] = file:/data/home/user/.m2/repository/org/ow2/asm/asm-analysis/4.1/asm-analysis-4.1.jar
[ERROR] urls[7] = file:/data/home/user/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
[ERROR] urls[8] = file:/data/home/user/.m2/repository/jaxen/jaxen/1.1-beta-8/jaxen-1.1-beta-8.jar
[ERROR] urls[9] = file:/data/home/user/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
[ERROR] urls[10] = file:/data/home/user/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar
[ERROR] urls[11] = file:/data/home/user/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar
[ERROR] urls[12] = file:/data/home/user/.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar
[ERROR] urls[13] = file:/data/home/user/.m2/repository/xom/xom/1.0b3/xom-1.0b3.jar
[ERROR] urls[14] = file:/data/home/user/.m2/repository/com/ibm/icu/icu4j/2.6.1/icu4j-2.6.1.jar
[ERROR] urls[15] = file:/data/home/user/.m2/repository/xalan/xalan/2.6.0/xalan-2.6.0.jar
[ERROR] urls[16] = file:/data/home/user/.m2/repository/org/ccil/cowan/tagsoup/tagsoup/0.9.7/tagsoup-0.9.7.jar
[ERROR] urls[17] = file:/data/home/user/.m2/repository/org/apache/ant/ant/1.8.3/ant-1.8.3.jar
[ERROR] urls[18] = file:/data/home/user/.m2/repository/org/apache/ant/ant-launcher/1.8.3/ant-launcher-1.8.3.jar
[ERROR] urls[19] = file:/data/home/user/.m2/repository/org/mortbay/jetty/servlet-api-2.5/6.1.14/servlet-api-2.5-6.1.14.jar
[ERROR] urls[20] = file:/data/home/user/.m2/repository/org/mortbay/jetty/jetty/6.1.14/jetty-6.1.14.jar
[ERROR] urls[21] = file:/data/home/user/.m2/repository/org/mortbay/jetty/jetty-util/6.1.14/jetty-util-6.1.14.jar
[ERROR] urls[22] = file:/data/java/jdk1.7.0_45/jre/../lib/tools.jar
[ERROR] urls[23] = file:/data/home/user/.m2/repository/log4j/log4j/1.2.9/log4j-1.2.9.jar
[ERROR] urls[24] = file:/data/home/user/.m2/repository/net/sourceforge/cobertura/cobertura-runtime/2.0.3/cobertura-runtime-2.0.3.pom
[ERROR] urls[25] = file:/data/home/user/.m2/repository/urbanophile/java-getopt/1.0.9/java-getopt-1.0.9.jar
[ERROR] urls[26] = file:/data/home/user/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
[ERROR] urls[27] = file:/data/home/user/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[28] = file:/data/home/user/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.8/maven-reporting-api-2.0.8.jar
[ERROR] urls[29] = file:/data/home/user/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-9/doxia-sink-api-1.0-alpha-9.jar
[ERROR] urls[30] = file:/data/home/user/.m2/repository/org/apache/maven/reporting/maven-reporting-impl/2.0.4.2/maven-reporting-impl-2.0.4.2.jar
[ERROR] urls[31] = file:/data/home/user/.m2/repository/commons-validator/commons-validator/1.2.0/commons-validator-1.2.0.jar
[ERROR] urls[32] = file:/data/home/user/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
[ERROR] urls[33] = file:/data/home/user/.m2/repository/commons-digester/commons-digester/1.6/commons-digester-1.6.jar
[ERROR] urls[34] = file:/data/home/user/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
[ERROR] urls[35] = file:/data/home/user/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
[ERROR] urls[36] = file:/data/home/user/.m2/repository/org/apache/maven/doxia/doxia-core/1.0/doxia-core-1.0.jar
[ERROR] urls[37] = file:/data/home/user/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.0/doxia-site-renderer-1.0.jar
[ERROR] urls[38] = file:/data/home/user/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
[ERROR] urls[39] = file:/data/home/user/.m2/repository/org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.jar
[ERROR] urls[40] = file:/data/home/user/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
[ERROR] urls[41] = file:/data/home/user/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.0/doxia-decoration-model-1.0.jar
[ERROR] urls[42] = file:/data/home/user/.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
[ERROR] urls[43] = file:/data/home/user/.m2/repository/org/apache/maven/doxia/doxia-module-apt/1.0/doxia-module-apt-1.0.jar
[ERROR] urls[44] = file:/data/home/user/.m2/repository/org/apache/maven/doxia/doxia-module-fml/1.0/doxia-module-fml-1.0.jar
[ERROR] urls[45] = file:/data/home/user/.m2/repository/org/apache/maven/doxia/doxia-module-xdoc/1.0/doxia-module-xdoc-1.0.jar
[ERROR] urls[46] = file:/data/home/user/.m2/repository/org/apache/maven/doxia/doxia-module-xhtml/1.0/doxia-module-xhtml-1.0.jar
[ERROR] urls[47] = file:/data/home/user/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
[ERROR] urls[48] = file:/data/home/user/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.2/plexus-utils-2.0.2.jar
[ERROR] urls[49] = file:/data/home/user/.m2/repository/org/apache/maven/shared/maven-invoker/2.0.11/maven-invoker-2.0.11.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: net.sourceforge.cobertura.util.CommandLineBuilder
[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/PluginContainerException
Build step 'Invoke top-level Maven targets' marked build as failure
Skipping Cobertura coverage report as build was not UNSTABLE or better ...
Finished: FAILURE
I have already cleared my local repository and tried running it again, but no luck.
Any other suggestions?
I am using Maven 3.1.0 and Java 1.7.0_45
UPDATE:
I am using Nexus as a repo manager. Looking in the logs I see:
[INFO] Failed to parse Maven artifact /data/home/user/sonatype-work/nexus/storage/central/net/sourceforge/cobertura/cobertura/2.0.3/cobertura-2.0.3.jar due to invalid CEN header (bad signature)
This seems to suggest that this jar is corrupt. But I keep trying to redownload it from Maven Central. Still stuck.
I was also facing this issue and the issue was with Java version in Maven. It may happen you have multiple JDK version in system or your Maven referring to some other JDK version.
So first you can check the maven and referring version by typing below command in your maven project directory.
mvn -v
ITSs-MacBook-Pro:workbench vshah$ mvn -v Apache Maven 3.6.3
(cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home:
/usr/local/Cellar/maven/3.6.3_1/libexec Java version: 1.8.0_241,
vendor: Oracle Corporation, runtime:
/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre
Default locale: en_GB, platform encoding: UTF-8 OS name: "mac os x",
version: "10.14.3", arch: "x86_64", family: "mac"
And check the maven and JDK version. If you found maven's JDK version not referring to required JDK version then you need to check your JAVA_HOME path. If you set JAVA_HOME path correctly it will work for sure.
Use this:-
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<reportSets>
<reportSet>
<reports>
<report>cobertura</report>
</reports>
</reportSet>
</reportSets>
</configuration>
</plugin>
Please check your path variable.
You might be pointing it to jre bin path, it should point to jdk bin.
I had the same issue, i did the above solution it worked for me.
Try out downloading from external site and place it in your local repository.
If you guys are using jenkins and facing issue while executing Descriptive jobs then check the configuration as well,
if you have selected Auto install option for maven and Java in "Global Tool configuration" then unclick it and add the directory manually where your maven and java is installed on jenkins server.
Most important line is A required class was missing while executing org.codehaus.mojo:cobertura-maven-plugin:2.6:instrument: net/sourceforge/cobertura/util/CommandLineBuilder.
Verify if the jar containing this class (i.e file:/data/home/user/.m2/repository/net/sourceforge/cobertura/cobertura/2.0.3/cobertura-2.0.3.jar) is corrupted. Is so, remove it from your local repository. If you're using a Repository Manager as well, verify it that one is corrupt as well and needs to be removed. Next give it another try.