i am getting the following error in mi maven pom.xml on a spring template project
"Description Resource Path Location Type
ArtifactDescriptorException: Failed to read artifact descriptor for org.slf4j:slf4j-api:jar:1.5.6: ArtifactResolutionException: Failure to transfer org.slf4j:slf4j-api:pom:1.5.6 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.slf4j:slf4j-api:pom:1.5.6 from/to central (http://repo.maven.apache.org/maven2): C:\Users\muhsin.HIFX.m2\repository\org\slf4j\slf4j-api\1.5.6\slf4j-api-1.5.6.pom.ahc0570cfa3a1934af5 (The system cannot find the file specified) pom.xml /sample line 1 Maven Dependency Problem"
my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.samples.spring</groupId>
<artifactId>spring-jpa-utility</artifactId>
<version>1.0.0.CI-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Spring JPA Utility</name>
<url>http://www.springframework.org</url>
<description>
<![CDATA[This project is a minimal jar utility with Spring configuration for JPA usage.]]>
</description>
<properties>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<spring.framework.version>3.0.6.RELEASE</spring.framework.version>
</properties>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.0.Final</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.1.0.Final</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.156</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<!-- <pluginRepositories>
<pluginRepository>
<id>Codehaus</id>
<url>http://repository.codehaus.org/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>org.jboss.repository.releases</id>
<name>JBoss Maven Release Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<downloadUrl>http://www.springframework.org/download</downloadUrl>
<site>
<id>staging</id>
<url>file:///${user.dir}/target/staging/org.springframework.batch.archetype/${pom.artifactId}</url>
</site>
<repository>
<id>spring-release</id>
<name>Spring Release Repository</name>
<url>file:///${user.dir}/target/staging/release</url>
</repository>
<snapshotRepository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>file:///${user.dir}/target/staging/snapshot</url>
</snapshotRepository>
</distributionManagement> -->
</project>
You can also use force update flag(-U) for example:
mvn clean install -U
Based on the error message
"Description Resource Path Location Type ArtifactDescriptorException:
Failed to read artifact descriptor for org.slf4j:slf4j-api:jar:1.5.6:
ArtifactResolutionException: Failure to transfer
org.slf4j:slf4j-api:pom:1.5.6 from http://repo.maven.apache.org/maven2
was cached in the local repository, resolution will not be reattempted
until the update interval of central has elapsed or updates are
forced.
it means you have to delete the folder $HOME/.m2/repository/org/slf4j and afterwards you need to rebuild via
mvn clean package
and other given error message:
Original error: Could not transfer artifact
org.slf4j:slf4j-api:pom:1.5.6 from/to central
(http://repo.maven.apache.org/maven2):
C:\Users\muhsin.HIFX.m2\repository\org\slf4j\slf4j-api\1.5.6\slf4j-api-1.5.6.pom.ahc0570cfa3a1934af5
(The system cannot find the file specified) pom.xml /sample line 1
Maven Dependency Problem"
indicates that you have some kind of problem with you repository access. Either you have a proxy which is not correctly configured. What i recommend is to use a repository manager which makes life easier.
You can try to run maven clean to perform a clean
You can manually navigate to the specified file in your local repository and remove it and then try to download it as afresh copy using mvn clean install -e
open this location
C:\Users...m2\repository\org\apache\maven\plugins\maven-surefire-plugin\2.10
Delete the file maven-surefire-plugin-2.10 and build the project.
it worked for me
Delete all the files present inside the folder **C:\Users\username.m2\repository**
open eclipse again rebuild the project - (Give some time for eclipse IDE to Build the Workspace).
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
add this line in the properties. Worked for me!
Related
I have a problem with run the maven install. when I imported the project, pom.xml file show an error:
Multiple annotations found at this line:
- 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: Failed to read artifact descriptor for
org.apache.felix:maven-bundle-plugin:jar:2.3.7
- 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
I had updated project and this step cannot solving this problem. when I run maven install or clean show an error:
[INFO] Scanning for projects...
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/felix/maven-bundle-plugin/2.3.7/maven-bundle-plugin-2.3.7.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.3.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin:jar:2.3.7 #
[ERROR] Unknown packaging: bundle # line 9, column 13
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.prudential.integration.middleware:crm-services:1.0.0-SNAPSHOT (C:\Users\c76266\Documents\workspace-sts-3.8.3.RELEASE\crm-services\pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.3.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin:jar:2.3.7: Could not transfer artifact org.apache.felix:maven-bundle-plugin:pom:2.3.7 from/to central (https://repo.maven.apache.org/maven2): unexpected end of stream on Connection{repo.maven.apache.org:443, proxy=HTTP # /10.171.74.5:8080 hostAddress=10.171.74.5 cipherSuite=none protocol=http/1.1} (recycle count=0): \n not found: size=0 content=... -> [Help 2]
[ERROR] Unknown packaging: bundle # line 9, column 13
[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
How to fixed this problem? below 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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.prudential.integration.middleware</groupId>
<artifactId>crm-services</artifactId>
<packaging>bundle</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>CRM SERVICES</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</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-core</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jaxb</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-mail</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
<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.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>3.0.4.redhat-620133</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<!-- Database -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-sql</artifactId>
<version>2.15.1.redhat-620133</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver.jdbc</groupId>
<artifactId>sqlserverjdbc</artifactId>
<version>4.1</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>com.prudential.integration.middleware</groupId>
<artifactId>common-utilities</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>com.prudential.integration.middleware.common</groupId>
<artifactId>prudential-fuse-common-dao</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.prudential.integration.middleware.common</groupId>
<artifactId>prudential-fuse-common-model</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.prudential.enc</groupId>
<artifactId>pruencutil</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- allows the route to be ran via 'mvn camel:run' -->
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>2.15.1.redhat-620133</version>
</plugin>
<!-- to generate the MANIFEST-FILE of the bundle -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>crm-service</Bundle-SymbolicName>
<Export-Package />
<Import-Package>*</Import-Package>
<Embed-Dependency>sqlserverjdbc,commons-lang3,commons-dbcp,commons-codec,commons-email,postgresql,pruencutil</Embed-Dependency>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
The problem probably occurs by proxy configuration (as Pierre B. mentions)
Create a maven project on my dev and install your pom.
It ended successfully.
IDE:Luna Service Release 2 (4.4.2) Build id: 20150219-0600
MAVEN Version:apache-maven-3.3.3
JDK:java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
note: remember to configure the maven file: settingsProxy.xml inside the conf folder inside the maven installation and configure it in the case of using eclipse path: windows-preferences-Maven-User Settings
Copy result:
I have added all dependencies(my project ,junit,etc) and surefire plugin. so it is executing successfully in eclipse but when run through command prompt it throws error. below is the attached screenshot. and the pom.xml file . embeeded maven settings in eclipse works.maven location is also getting recognised from command prompt
BUILD FAILURE ERROR
<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.selenium</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-server
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.53.1</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/com.codeborne/phantomjsdriver -->
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.mail/javax.mail -->
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.6</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>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.inject/guice -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- Dependency for POI API -->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<testFailureIgnore> false </testFailureIgnore>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/runner/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
From the error, it says maven try to download a depedency jar from this remote maven center repository: https://repo.maven.apache.org/maven2/
Because this repository is a SSL website, you need to install its certification to pass the auth. And Maven run by JDK, so you need to import the certication into JDK Security Store.
The reason why you can pass in eclipse is eclipse use a different settings.xml as run maven command, maybe eclipse not use the SSL repository.
There are two options:
1) Don't use SSL maven remote repository, specify a HTTP repository:http://repo1.maven.org/maven2 in your manve settings.xml, like below:
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>securecentral</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>securecentral</id>
<!--Override the repository (and pluginRepository) "central" from the
Maven Super POM -->
<repositories>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
2) Import certification in JDK Security Store
find the step to import in this post:
Problems using Maven and SSL behind proxy
I think you are using two different maven,usually eclipse comes with its own maven version. You can verify you are using same Maven installation in eclipse and from command prompt.
You can verify maven installation in eclipse by going to
Preference--> Maven--> Installation.
From command prompt, check for Maven home/M2 home.
I have a project that is using these dependencies:
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.identity.oauth.stub</artifactId>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.utils</artifactId>
<version>4.2.0</version>
</dependency>
It seems that these dependencies are not available anymore.
Do you know any other versions of them?
WSO2 artifacts are not available on Maven Central.
You need to add the following repository :
<repositories>
<repository>
<id>wso2-maven2-repository</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public</url>
</repository>
</repositories>
<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>org.geoserver</groupId>
<artifactId>hello_wps</artifactId>
<packaging>jar</packaging>
<version>8-ENTERPRISE-SNAPSHOT</version>
<name>hello_wps</name>
<dependencies>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-process</artifactId>
<version>8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>main</artifactId>
<version>8-ENTERPRISE-SNAPSHOT</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mockrunner</groupId>
<artifactId>mockrunner</artifactId>
<version>0.3.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>opengeo</id>
<name>opengeo</name>
<url>http://repo.opengeo.org</url>
</repository>
</repositories>
</project>
i'm new to maven and geoserver as well. was just trying basic installation of geoserver and found the error in POM.XML file of maven project. Error is shown in two <dependency> tabs which are exactly 1st and 2nd after <dependencies> tab.
Errors :
Missing artifact org.geotools:gt-process:jar:8-SNAPSHOT
Missing artifact org.geoserver:main:jar:tests:8-ENTERPRISE-SNAPSHOT
Thanks for the solution in advance.
If you look at the quick start docs for geotools:
http://docs.geotools.org/latest/userguide/tutorial/quickstart/maven.html
step 7 "under Creating a new project"
If you are using a nightly build (such as 14-SNAPSHOT) and add a
reference to the snapshot repository.
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>boundless</id>
<name>Boundless Maven Repository</name>
<url>http://repo.boundlessgeo.com/main</url>
</repository>
</repositories>
I have taken a quick look at the versions available in this repository and to use it, you will need to change your maven co-ordinates to something like:
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-process</artifactId>
<version>10-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>main</artifactId>
<version>2.4.8</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
as the original versions you are after are not present.
I just downloaded a Spring tutorial off the internet and am trying to run it in my local workspace. To do it, I first tried to get all the dependant jars needed by the project. I tried maven build and it failed because dependant jar's were missing from my local repository and those jar's were also missing from the remote repository(the one which my project uses)
Initially, my settings.xml only has a reference to the remote repository url which is used across the organization by various projects. I cannot expect it to be uptodate with latest jars. Can I get the remote repository names of the various utility projects fore.g for Log4j, commons logging, spring jars etc. I can then put these repository urls in my setting.xml to solve my issue.
EDIT:
I even tried "http://repo1.maven.org/maven2/" which I thought houses all the required latest jars but even this wont work.
Example..
Missing:
1) log4j:log4j:jar:1.2.13
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=log4j -DartifactId=log4j \
-Dversion=1.2.13 -Dpackaging=jar -Dfile=/path/to/file
Path to dependency:
1) com.mkyong.core:Spring3Example:jar:1.0-SNAPSHOT
2) org.codehaus.castor:castor:jar:1.1.2.1
3) log4j:log4j:jar:1.2.13
2) xerces:xerces:jar:1.4.0
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=xerces -DartifactId=xerces \
-Dversion=1.4.0 -Dpackaging=jar -Dfile=/path/to/file
Path to dependency:
1) com.mkyong.core:Spring3Example:jar:1.0-SNAPSHOT
2) org.codehaus.castor:castor:jar:1.1.2.1
3) xerces:xerces:jar:1.4.0
3) commons-lang:commons-lang:jar:2.5
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=commons-lang -DartifactId=commons-lang
\
-Dversion=2.5 -Dpackaging=jar -Dfile=/path/to/file
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mkyong.core</groupId>
<artifactId>Spring3Example</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Spring3Example</name>
<url>http://maven.apache.org</url>
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<!-- Spring 3 dependencies -->
<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-oxm</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Uses Castor for XML -->
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
<version>1.1.2.1</version>
</dependency>
<!-- Castor need this -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
</dependencies>
My setting .xml
<settings>
<localRepository>
C:\Repository
</localRepository>
<interactiveMode>true</interactiveMode>
<offline>false</offline>
<profiles>
<profile>
<id>R2</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>Log4j</id>
<url>http://central.maven.org/maven2</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>Artifact_Repository_Plugin</id>
<url>http://central.maven.org/maven2</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<pluginGroups>
<pluginGroup>com.hsbc.alm.maven.plugins</pluginGroup>
<pluginGroup>com.hsbc.alm.maven.scm</pluginGroup>
<pluginGroup>com.hsbc.alm.maven.jr2</pluginGroup>
</pluginGroups>
</settings>
Yes you are on the right path all you need to do is this or a good solution would be to generate a new archetype with the all added jar files which you have downloaded. And then using the same artifact whenever you make a similar project.
Even if you are lacking with the m2Eclipse plugin , you can use the following commands.
This can be achieved if you follow the commands as:
Move to the project and type the following command to make the project as archetype
mvn archetype:create-from-project
Install the archetype to the local repository
mvn install
Move to some directory where you wish to locate the new project created with your created archetype
mvn archetype:generate -DarchetypeCatalog=local
If a list is populated with numbers to filter then select accordingly and you are done.
This one is building successfully (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.test.new.project</groupId>
<artifactId>dadada</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dadada</name>
<url>http://maven.apache.org</url>
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<!-- Spring 3 dependencies -->
<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-oxm</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Uses Castor for XML -->
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
<version>1.1.2.1</version>
</dependency>
<!-- Castor need this -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
</dependencies>
</project>
My 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">
<proxies>
</proxies>
<servers>
</servers>
<mirrors>
</mirrors>
<profiles>
</profiles>
</settings>
Not sure why you need to alter settings.xml is there specific reason?
Environment info :
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_29
I was finally able to solve the jar download issue by defining proxy settings in my settings.xml. My company uses a proxy to communicate with outside world.Having said that, I also learnt that there is no need to define specific remote repository in settings.xml bcos maven by default searches in its own repository which mostly has all the opensource jars.
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>xyz.hk.hsbc</host>
<port>8080</port>
</proxy>
</proxies>