unable to build opendaylight project in maven - maven

Anyone tried to configure opendaylight maven environment in ubuntu??? following steps in the url https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Startup_Project_Archetype.... I'm not able to complete the steps, stopped with "Peer Not Authenticated" error while trying to build the project. I tried to install certificates using installCert java and keytool etc... it is not working at all... is there any other way out there to build this project or any environment to run a yang program? please help. thanks in advance.

Hope you've added repository in your maven settings.xml. Once added please maven sure while running its taking your settings.xml.
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>downloadSources</id>
<properties>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties>
</profile>
<profile>
<id>opendaylight-release</id>
<repositories>
<repository>
<id>opendaylight-mirror</id>
<name>opendaylight-mirror</name>
<url>http://nexus.opendaylight.org/content/repositories/public/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>opendaylight-mirror</id>
<name>opendaylight-mirror</name>
<url>http://nexus.opendaylight.org/content/repositories/public/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>opendaylight-snapshots</id>
<repositories>
<repository>
<id>opendaylight-snapshot</id>
<name>opendaylight-snapshot</name>
<url>http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>opendaylight-snapshot</id>
<name>opendaylight-snapshot</name>
<url>http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>maven-central-repo</id>
<repositories>
<repository>
<id>cetral-repo</id>
<name>maven-central-repo</name>
<url>http://repo1.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>cetral-repo</id>
<name>maven-central-repo</name>
<url>http://repo1.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!-- <activeProfile>maven-central-repo</activeProfile> -->
<activeProfile>opendaylight-release</activeProfile>
<activeProfile>opendaylight-snapshots</activeProfile>
<activeProfile>downloadSources</activeProfile>
</activeProfiles>
</settings>

Related

Vaadin-addons Maven POM File Configuration

I can't get a Vaadin + Spring project built due to vaadin-addons while someone can get it built. The pom file already has the addons repository. The following is the structure of the pom.xml. What is missing? Is the addons repository in a wrong place?
<dependencies>
…
<!-- Vaadin dependencies -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>vaadin-combobox-multiselect</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>vaadin-grid-util</artifactId>
<version>2.1.1</version>
</dependency>
…
</dependencies>
...
<profiles>
<profile>
<!-- Vaadin pre-release repositories -->
<id>vaadin-prerelease</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
...
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
Update:
I solve this probule by adding the following in the pom file
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>vaadin-addons</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>sonatype vaadin</id>
<url>https://oss.sonatype.org/content/repositories/vaadin/</url>
</repository>
<repository>
<id>vaadin-prereleases</id>
<url>https://maven.vaadin.com/vaadin-prereleases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2/</url>
</pluginRepository>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>https://maven.vaadin.com/vaadin-prereleases</url>
</pluginRepository>
</pluginRepositories>
You have defined a profile with the id <id>vaadin-prerelease</id> and the repositories are defined only under that profile. I think this is not what you want; instead, you should define the <repositories> on the same level as <dependencies>. Repositories for a specific profile are only used if you're building with that profile enabled.

error pom.xml error resolving version and error packaging

I found the error in my pom.xml. the error below:
Multiple annotations found at this line:
- Error resolving version for plugin 'org.apache.maven.plugins:maven-site-plugin' from the repositories
[local (C:\Users\c76266.m2\repository), release.fusesource.org
(http://repo.fusesource.com/nexus/content/repositories/releases),
ea.fusesource.org
(http://repo.fusesource.com/nexus/content/groups/ea), central
(https:// repo.maven.apache.org/maven2)]: Plugin not found in any
plugin repository
- Project build error: Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.3.7 or one of its dependencies
could not be resolved: The following artifacts could not be
resolved: org.apache.maven:maven-core:jar:2.0.7,
org.apache.maven:maven-settings:jar:2.0.7,
org.apache.maven:maven-plugin-parameter-documenter:jar:
2.0.7, org.apache.maven:maven-profile:jar:2.0.7, org.apache.maven:maven-model:jar:2.0.7,
org.apache.maven:maven-artifact:jar:2.0.7,
org.codehaus.plexus:plexus-container-
default:jar:1.0-alpha-9-stable-1,
org.apache.maven:maven-repository-metadata:jar:2.0.7,
org.apache.maven:maven-error-diagnostics:jar:2.0.7,
org.apache.maven:maven- project:jar:2.0.7,
org.apache.maven:maven-plugin-registry:jar:2.0.7,
org.apache.maven:maven-plugin-api:jar:2.0.7,
org.apache.maven:maven-plugin-descriptor:jar:2.0.7,
org.apache.maven:maven-artifact-manager:jar:2.0.7,
org.apache.maven:maven-monitor:jar:2.0.7,
classworlds:classworlds:jar:1.1: Could not transfer artifact
org.apache.maven:maven-core:jar:2.0.7 from/to central
(https://repo.maven.apache.org/maven2): unexpected end of stream on
Connection{repo.maven.apache.org:443, proxy=HTTP #
idnproxy.pru.intranet.asia/10.171.74.5:8080 hostAddress=10.171.74.5
cipherSuite=none protocol=http/1.1} (recycle count=0)
Project build error: Unknown packaging: bundle
How to fix this problem? thanks.
The Maven xml include seems to be fine code wise, so I'd say you have imported/installed something wrong, a different version maybe?
this is my 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.prudential.integration.middleware.common</groupId>
<artifactId>prudential-fuse-common-model</artifactId>
<version>1.0.1</version>
<packaging>bundle</packaging>
<name>Prudential Fuse Common Model</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>release.fusesource.org</id>
<name>FuseSource Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>ea.fusesource.org</id>
<name>FuseSource Community Early Access Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/groups/ea</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>release.fusesource.org</id>
<name>FuseSource Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>ea.fusesource.org</id>
<name>FuseSource Community Early Access Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/groups/ea</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.15.1.redhat-620133</version>
<exclusions>
<exclusion>
<artifactId>asm</artifactId>
<groupId>asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>3.0.4.redhat-620133</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jaxb</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Import-Package>*</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

Setting up a Maven Project that Utilizes Artifactory

Hello I am new to Maven and am trying to create a Maven project that:
Has dependencies that only Pull from Artifactory
Have artifacts only publish to Artifactory
Can change where artifacts are published (Integration or Dev)
Artifact published can be used as Dependencies
When published to Integration the maven pom file will be able to pass credentials, that is not accessible/viewable in the build output
Connection to artifactory not required to build/publish (Can publish locally)
Project can be built on the command line without eclipse on the machine
Currently this is the code I have for the Maven Pom file:
<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">
<repositories>
<repository>
<id>central</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven Quick Start Archetype</name>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<dependencies>
<dependency>
<groupId>Test</groupId>
<artifactId>Test</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
I'm more than certain this isn't set up correctly as this is my first time using Maven.
Edit: I have been reading from the Jfrog site that was suggested and while it has somewhat helped I am still not certain if what I have is correct by any means.
<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>
<!-- The Basics -->
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<packaging>...</packaging>
<dependencies>
<dependency>
<groupId>Test</groupId>
<artifactId>Test</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<parent>...</parent>
<dependencyManagement>...</dependencyManagement>
<modules>...</modules>
<properties>...</properties>
<!-- Build Settings -->
<build>...</build>
<reporting>...</reporting>
<!-- More Project Information -->
<name>Maven Quick Start Archetype</name>
<description>...</description>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<inceptionYear>...</inceptionYear>
<licenses>...</licenses>
<developers>...</developers>
<contributors>...</contributors>
<!-- Environment Settings -->
<issueManagement>...</issueManagement>
<ciManagement>...</ciManagement>
<mailingLists>...</mailingLists>
<scm>...</scm>
<prerequisites>...</prerequisites>
<repositories>
<repository>
<id>central</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>ArtifactoryDeploy</id>
<name>ArtifactoryDeployThing</name>
<url>http://artifactory/artifactory/webapp/home.html?2</url>
</distributionManagement>
<profiles>...</profiles>
</project>

Maven 3 build issue with Spring Framework 4 - NoSuchMethodError

I was using Spring 4 and Maven 3 for my new project. However I got the following error. I tried removing all cached libraries from ~/.m2/repository/ but it didn't help.
Here is the exception when running mvn clean install:
Apr 29, 2014 4:41:21 PM org.springframework.test.context.TestContextManager prepareTestInstance
SEVERE: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener#53ce669e] to prepare test instance [com.xxx.SmokeTest#13b33a0e]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:319)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:212)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:232)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:175)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [file:src/main/webapp/WEB-INF/applicationContext.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.support.DefaultListableBeanFactory.getDependencyComparator()Ljava/util/Comparator;
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadBeanDefinitions(AbstractGenericContextLoader.java:235)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:118)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:250)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
... 31 more
Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.support.DefaultListableBeanFactory.getDependencyComparator()Ljava/util/Comparator;
at org.springframework.context.annotation.AnnotationConfigUtils.registerAnnotationConfigProcessors(AnnotationConfigUtils.java:190)
at org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser.parse(AnnotationConfigBeanDefinitionParser.java:47)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:185)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
... 44 more
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.621 sec <<< FAILURE!
Here is the maven repo settings and dependencies:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.0.3.RELEASE</spring.version>
<spring.oauth2.version>1.0.5.RELEASE</spring.oauth2.version>
<spring.security.version>3.2.3.RELEASE</spring.security.version>
<spring.jaxws.version>1.9</spring.jaxws.version>
<jax-ws.version>2.2.9-b14002</jax-ws.version>
<jee.servlet.version>2.5</jee.servlet.version>
<junit.version>4.7</junit.version>
<commons-lang.version>2.4</commons-lang.version>
<commons-io.version>2.0.1</commons-io.version>
<gson.version>1.6</gson.version>
<maven-compiler-plugin.version>1.6</maven-compiler-plugin.version>
<maven-j2ee-plugin.version>1.5.1</maven-j2ee-plugin.version>
<mockito.version>1.8.5</mockito.version>
</properties>
<dependencies>
<!-- Spring framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>${jax-ws.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>17.0</version>
</dependency>
<!--dependency>
<groupId>org.apache.geronimo.configs</groupId>
<artifactId>aspectj</artifactId>
<version>2.2.1</version>
</dependency-->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${maven-compiler-plugin.version}</source>
<target>${maven-compiler-plugin.version}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Maven Plugin Repository</name>
<url>http://repo1.maven.org/maven3</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
<pluginRepository>
<id>xx_local</id>
<name>xx Local</name>
<url>http://maven.xx.com:80/nexus/content/groups/public</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
<pluginRepository>
<id>apache-snapshots</id>
<name>Apache Snapshot Repository</name>
<url>https://repository.apache.org/content/groups/staging/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>codehaus.snapshots</id>
<url>http://snapshots.repository.codehaus.org</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>XX</id>
<name>XX Maven Repository</name>
<url>http://maven.xx.com:80/nexus/content/groups/public</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
<repository>
<id>gson</id>
<url>http://google-gson.googlecode.com/svn/mavenrepo</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>tokyotyrant-java</id>
<url>http://tokyotyrant-java.googlecode.com/svn/maven/repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>mockito-all</id>
<url>http://repo2.maven.org/maven2/org/mockito/mockito-all</url>
</repository>
<repository>
<id>http-client</id>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</repository>
<repository>
<id>repository.springframework.maven.milestone</id>
<name>Spring Framework Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>plexus snapshots</id>
<url>https://oss.sonatype.org/content/repositories/plexus-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>maven central</id>
<url>repo1.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>repository.jboss.org</id>
<url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>couch base</id>
<url>http://files.couchbase.com/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>java.net</id>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>spring-milestone</id>
<name>Spring Framework Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
</repository>
<repository>
<id>spring-release</id>
<name>Spring Framework Release Repository</name>
<url>http://maven.springframework.org/release</url>
</repository>
<repository>
<id>spring-snnapshot</id>
<name>Spring Maven SNAPSHOT Repository</name>
<url>http://maven.springframework.org/snapshot</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>xx_local</id>
<url>http://maven.xx.com:80/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>xx_local</id>
<url>http://maven.xx.com:80/nexus/content/repositories/snapshots</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>
I intentionally changed some business names in the config and URLs for privacy considerations.
Yes it turned out to be due to conflict jars buried in some spring dependencies. Spring-security-oauth2 1.0.5 relies on spring-asm and spring-context-support 3.1.3 which are in conflict with Spring 4 libs. After excluding them problem is fixed.
This may be a long shot but from personal experience last time i had this error it was due to the key point:
java.lang.IllegalStateException: Failed to load ApplicationContext
I had a test case that didn't have ApplicationContext in it and thus was causing the compilation to fail with that above.
Check if you have any test classes that are missing a ApplicationContext (as i said long shot).
If they are the add it otherwise we will need to dig more into this problem.
Good luck

Maven missing artifact com.sun.jndi.ldap. What's wrong?

How can I fix the missing artifact error in maven with the com.sun.jndi.ldap? I also tried to add the java repositories because of the strange binary licensing. This is my 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>ActiveDirectory</groupId>
<artifactId>my.activedirectory</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>my.activedirectory</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>java.net</id>
<url>http://download.java.net/maven/2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>java.net</id>
<url>http://download.java.net/maven/2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.java.dev.swing-layout</groupId>
<artifactId>swing-layout</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>com.sun.jndi</groupId>
<artifactId>ldap</artifactId>
<version>1.2.4</version>
</dependency>
</dependencies>
</project>
Can anybody help me with this issue?
I had the similar situation in looking up for Jndi jar using Maven.
Maven Central repo does not have this jar anymore.
You can download these jars from Oracle Archive #http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-java-plat-419418.html
and then install it into your local repository. This will solve the problem.
mvn install:install-file -DgroupId=javax.naming -DartifactId=jndi -Dversion=1.2.1 -Dpackaging=jar -Dfile=jndi-1_2_1.jar
Missing artifact exception occurs where the jar which you are looking for is not found in the repository where you have pointed to. I am afraid this jar or its latest version that you refer to is not available in the http://download.java.net/maven/2 repo.
Try jBoss repository or mavens central repo
<repository>
<id>jboss-maven2</id>
<name>JBoss Repository</name>
<url>http://repository.jboss.com/maven2</url>
</repository>
or
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>http://repo1.maven.org/maven2</url>
</repository>

Resources