EPAM :: LightingTalks :: Oct 2013
-
Upload
vyacheslav-yakovenko -
Category
Technology
-
view
71 -
download
1
Transcript of EPAM :: LightingTalks :: Oct 2013
Problem description
GroupId: com.wolterskluwer.services.configuration.conversionArtifactId: testVersion: 0.0.3Build: latest
• Service to manage maven artifacts• Get latest version (version+build No)• Download latest version
Old VS new (API) implementation
Old implementation:
• What if repository provider will be another? (new version)
• What if repository is secured?
New implementation requirements:
• Support configurable repositories (in XML style)
• Support security
• Make code robust and clean
Libraries and workflow
1. Read Maven settings (settings.xml)• maven-settings-builder (org.apache.maven)
2. Populate Aether repositories from Step 1• Aether-api
• Aether-util
3. Build artifactRequest
4. Create local repository• Aether-impl
5. Resolve artifact
To sum
• Only one possible approach to deal with Maven
• Pure documentation
• Lack of examples
• Get latest version means update local repository
Where to find
• Aether: http://eclipse.org/aether/
• Maven: http://maven.apache.org
• Example: http://git.eclipse.org/gitroot/aether/aether-demo.git
• Contact me ([email protected])
Appendix settings.xml<?xml version="1.0" encoding="UTF-8"?>
<settings …-->
<servers>
<server>
<id>archiva</id>
<username>USER</username>
<password>PASWORD</password>
</server>
</servers>
<!-- Where to store maven repo. Default is java.io.tmpdir folder -->
<localRepository>D:/repo</localRepository><activeProfiles>
<activeProfile>profile1</activeProfile></activeProfiles>
<profiles>
<profile>
<id>profile1</id>
<repositories>
<repository>
<id>archiva</id>
<url>http://url.to/repo/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
</repositories>
</profile>
</profiles>
</settings>