Maven :How to use local archiva repository in project? - maven

Downloaded Apache Archiva and uploaded 10 Jar file on it now i want to use this Archiva repository in my pom.xml so these 10 jar download from the Archiva ..What all setting i have to do i made changes in my pom.xml file like below
<repository>
<id>internal</id>
<name>Archiva Managed Internal Repository</name>
<url>http://serverip:8888/archiva/repository/internal/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
Also added all jar in pom.xml file
<dependency>
<groupId>org.forum</groupId>
<artifactId>jforum</artifactId>
<version>2.3.5</version>
</dependency>
<dependency>
<groupId>org.imaging</groupId>
<artifactId>imaging</artifactId>
<version>01012005</version>
</dependency>
<dependency>
<groupId>org.jbosscaches</groupId>
<artifactId>jboss-logging-spi</artifactId>
<version>2.1.2.GA</version>
</dependency>
But i am getting
Missing artifact org.jbosscaches:jboss-transaction-api:jar:1.0.1.GA
What all i am missing?

I made the following changes it worked now
<url>http://ipaddress:8888/repository/internal/</url>

Related

3rdparty repository issues with maven pom.xml

I was looking for BIRT Dependency in the net. Package my code refers are
import org.eclipse.birt.chart.model.Chart;
import org.eclipse.birt.chart.model.attribute.Anchor;
It is using chartengineapi and below is the maven dependency entry for POM.
<!-- https://mvnrepository.com/artifact/org.eclipse.birt/chartengineapi -->
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>chartengineapi</artifactId>
<version>2.3.2</version>
</dependency>
Since it is part of other repository (https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/) it gives error in Pom.xml. Could any one help me to sort out this ?
added repository tag and resolved.
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
Add one more <repository></repository> and the give the new repo name and link. It worked for me though I am not sure whether this is a standard approach.

Could not find artifact org.wildfly:wildfly-parent:jar:10.0.0.Final. Where is it?

I'm trying to add server module dependencies for wildfly 10.0.0 Final in my pom but I can't find a a working repository.
I have this in my pom:
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-parent</artifactId>
<version>10.0.0.Final</version>
</dependency>
and I tried to add the jboss repository:
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
and what I get is this:
Could not find artifact org.wildfly:wildfly-parent:jar:10.0.0.Final in jboss-public-repository-group (http://repository.jboss.org/nexus/content/groups/public/
I checked the repository. The pom is actually there but the jar at:
http://repository.jboss.org/nexus/content/groups/public/org/wildfly/wildfly-parent/10.0.0.Final/wildfly-parent-10.0.0.Final.jar
is not.
Which repository should I add?

spring-security-saml missing jar in repo

As per the instructions on http://projects.spring.io/spring-security-saml/, I have the following in my pom.xml:
<dependencies>
<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml</artifactId>
<version>1.0.0.RC2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
When I execute mvn clean install -U, I receive the following error:
[ERROR] Failed to execute goal on project myproj: Could not resolve dependencies
for project com.acme.myproj:myproj:war:1.0.0-SNAPSHOT: Could not find artifact org.
springframework.security.extensions:spring-security-saml:jar:1.0.0.RC2 in spring
-milestones (http://repo.spring.io/milestone) -> [Help 1]
The repo is there at http://repo.spring.io/milestone/org/springframework/security/extensions/spring-security-saml/1.0.0.RC2/, but there is no .jar file.
The correct dependency to use is:
<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml2-core</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
The jar is available both in Maven Central and http://repo.spring.io/list/release/
The Spring SAML web will get fixed soon.

mvn release plugin releasing next snapshot not current release

Hello I've been releasing a project from my workstation with no problems. I've recently tried releasing another project from 1.0.0-SNAPSHOT. However when it actually does the release it releases 1.0.1-SNAPSHOT to the snapshots repository instead of 1.0.0 to releases repository.
I've done dryRun=true and it seems fine. In fact it defaults me to the versions:
What is the release version for "Appname"? (...) 1.0.0: :
What is SCM release tag or label for "Appname"? (...) Appname-1.0.0: :
What is the new development version for "Appname"? (...) 1.0.1-SNAPSHOT: :
I take all the defaults.
However when i do the "mvn release:perform"
This is what it does:
[INFO] Uploading: http://{corporate-nexus-site}/snapshots/{app-path}/1.0.1-SNAPSHOT/fei-logging-formatter-1.0.1-20140929.153303-1.jar
...
[INFO] [INFO] BUILD SUCCESS
I'm using latest maven and i manually added latest release plugin. And I can release another project using same parent and settings.xml setup.
Looking at the properties file after a dryrun and prepare it all looks right to me.
I thought originally i had my distribution set up wrong, and was releasing a release to the snapshot repository, but as you can see its actually thinking its doing a good job and releasing a snapshot.
confused royally.
Any ideas on what to try?
thanks.
UPDATE: In the project I updated the pom from 1.0.0-SNAPSHOT to 1.0.0 and did a "mvn deploy" and it put it exactly where I expected in releases, without out all the goodies of course.
UPDATE2: Pom (company name to protect the guilty)
<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>logging-formatter</groupId>
<artifactId>logging-formatter</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Logging Formatter</name>
<description>logging tool to format your logging in the standard cn way.</description>
<parent>
<groupId>com.companyname.pom.parent.master</groupId>
<artifactId>cn-pom-parent-master</artifactId>
<version>2014.3.0</version>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
</build>
<scm>
<url>http://svn.sys.ds.companyname.com/svn/cn-logging</url>
<connection>scm:svn:http://svn.sys.ds.companyname.com/svn/cn-logging</connection>
<developerConnection>scm:svn:http://svn.sys.ds.companyname.com/svn/cn-logging</developerConnection>
</scm>
<organization>
<name>CompanyName Enterprises</name>
</organization>
<ciManagement>
<system>Jenkins</system>
<url>http://jenkins.sys.ds.companyname.com:8080/job/cn-logging-DEVELOP/</url>
</ciManagement>
</project>
UPDATE3: Adding parent settings info
SETTINGS.XML
<repositories>
<repository>
<id>fei-releases</id>
<name>Ferguson Release Repository</name>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<url>http://{companyname}/nexus/content/repositories/releases</url>
<layout>default</layout>
</repository>
<repository>
<id>fei-snapshots</id>
<name>Ferguson Snapshot Repository</name>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<url>http://{companyname}/nexus/content/repositories/snapshots/</url>
<layout>default</layout>
</repository>
<repository>
<id>fei-thirdparty</id>
<name>Ferguson 3rd Party Repository</name>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<url>http://{companyname}/nexus/content/repositories/thirdparty/</url>
<layout>default</layout>
</repository>
</repositories>
PARENT REPOSITORIES:
<repositories>
<repository>
<id>third-party</id>
<name>3rd Party Repository</name>
<url>http://{companyname}/nexus/content/repositories/thirdparty/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories/>
PARENT DISTRIBUTION MANAGEMENT:
<distributionManagement>
<repository>
<id>fei-releases</id>
<name>Ferguson Release Repository</name>
<url>http://{companyname}/nexus/content/repositories/releases</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>fei-snapshots</id>
<name>Ferguson Snapshot Repository</name>
<url>http://{companyname}/nexus/content/repositories/snapshots</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
i did a "mvn release:clean release:prepare" then a "mvn
release:perform" Same steps I used to release another project without
issue using the same parent.
So you have another project that is deployed fine after release? (you see the release version in the repo)?
If so, it sounds like an issue in your 'problematic' project. Can you share its pom.xml?
#SteveHolt,
I see a red flag in your pom.xml file:
<scm>
<url>http://svn.sys.ds.companyname.com/svn/cn-logging</url>
<connection>scm:svn:http://svn.sys.ds.companyname.com/svn/cn-logging</connection>
<developerConnection>scm:svn:http://svn.sys.ds.companyname.com/svn/cn-logging</developerConnection>
</scm>
None of these urls contain the trunk, branches, or tags keywords.
Consequently, when Maven creates the release tag, it tells SVN to use the same url as before:
http://svn.sys.ds.companyname.com/svn/cn-logging
When release-prepare runs, it performs
$ svn checkout http://svn.sys.ds.companyname.com/svn/cn-logging/
but it can't tell apart the release tag from the development trunk.
Therefore it retrieves the post-release snapshot revision (which is the latest commit) rather than the release revision (the preceding commit).
Solution:
Create a trunk dir under cn-logging and move all your code into it:
svn/cn-logging/
trunk/
pom.xml
src/
main/
java/
branches/
tags/
Hope that helps.

Pom.xml throws Missing artifact error for org.springframework.security.extentions continously

Below is a small part my pom.xml for SSO using SAML,
<properties>
<SAML-version>1.0.0-RC2-SNAPSHOT</SAML-version>
</properties>
<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml2-core</artifactId>
<version>${SAML-version}</version>
</dependency>
for which STS(spring tool suite 3.1) throws below error continuosly,
"Missing artifact org.springframework.security.extensions:spring-security-saml2- core:jar:1.0.0-RC2-SNAPSHOT".
I navigated to maven repo and i can find the jar downloaded by maven.
Kindly help me.
Thanks,Selva
Add This
<repositories>
<repository>
<id>repo.springsource.org</id>
<name>repo.springsource.org-snapshots</name>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
The Spring Security SAML website is currently incorrect.. The groupId should actually be org.springframework.security.extensions instead of just org.springframework.security.
The below dependency configuration works for me:
<dependencies>
<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml2-core</artifactId>
<version>1.0.0.RC2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

Resources