3

I am working on project which has multiple dependencies. Most of the dependencies are available at our centralized maven repository. My project includes some JARs which only specific to my application and unavailable at our Maven repo. Due to some policy/restriction i cant deploy that jars to our maven repository.

When i install these jars in my local repository(i.e.UserHome/.m2/repository) and compile the code its working fine.

Now i want these dependencies in SVN so that we can build the application package using Continuum.(We cant refer local dependency from Continuum server.)

Just to achieve these i copied the locally installed dependency from .m2/repository and committed it in SVN. Then i declared repository in pom.xml like..

<repositories>
  <repository>
      <id>repo.pu</id>
      <name>repo.pu</name>
      <url>https://URL/migration2/APP1/src/main/lib/</url>
      <layout>default</layout>
  </repository>
</repositories>

Now to use dependency from above repo i added code like...

<dependencies>
<dependency>
  <groupId>repo.pu</groupId>
  <artifactId>Ptestval</artifactId>
  <version>1.0</version>
</dependency>
</dependencies>

When i type mvn verify i am getting the below error..

[ERROR] Failed to execute goal on project APP1: Could not resolve dependencies f
or project fileservices.migration2:APP1:jar:1.0: Failed to collect dependencies
for [repo.pu:Ptestval:jar:1.0 (compile)]: Failed to read artifact descriptor for
repo.pu:Ptestval:jar:1.0: Could not transfer artifact repo.pu:Ptestval:pom:1.0
from/to repo.pu (https://URL/migration2/APP1/src/main/lib/): Access denied to: 
https://URL/migration2/APP1/src/main/lib/repo/pu/Ptestv
al/1.0/Ptestval-1.0.pom -> [Help 1]

Could you please someone help me to resolve these issue?

EDIT: I created a repository like ..

    <repositories>
       <repository>
       <id>repo.pu</id>
       <name>repo.pu</name>
       <url>https://SVNUserName:SVNPassword@SVN_URL/BaseProj/ProjA/src/main/lib</url> 
       <layout>default</layout>
       </repository>
     </repositories>

This technique works perfectly at my Personal laptop. Maven downloads the listed dependency from repo.

But when tries to use the same in my project on company network it is not working .. It gives the same error which i was getting before using this approach.

Can anyone help me please? What would be problem? Is it a network issue?

pradeep
  • 61
  • 2
  • 4
  • First if you are developing components and can't deploy into the internal maven repository (Repository Manager) maven does not make sense. You should change that or let change that. – khmarbaise Dec 09 '11 at 10:19

2 Answers2

3

Set up a repository manager like Nexus and don't abuse Subversion for something it was not designed for. This is unfortunately done in Google Code.

Michael-O
  • 18,123
  • 6
  • 55
  • 121
  • I agree with you... We are already using **Archiva** to maintain repository but due to some restriction on adding artifact to repo we can't install our JAR as an artifact on repo. I know that SVN is not for this purpose. Is there any way to get the dependency from subversion? Whatever error i am getting seems to be due to authentication... can you please help me to resolve this issue? Whatever i did, is this a correct way? – pradeep Dec 09 '11 at 17:26
  • Why not? Who will check that? I have done the same with Oracle JDBC driver. The `system` scope provides for this is deprecated but it's doable with that. – Michael-O Dec 10 '11 at 16:18
1

You must configure your project to use wagon-scm. See http://maven.apache.org/wagon/wagon-providers/wagon-scm/usage.html

Olivier Lamy
  • 2,280
  • 1
  • 14
  • 12
  • Could you please point some more links where i can get some example code? – pradeep Dec 11 '11 at 12:06
  • Olamy thanks for the help!!! Thanks a lot. Your help resolved my issue. Its done.. – pradeep Dec 11 '11 at 16:32
  • I created a repository in pom.xml with URL like "https://svnUserName:svnPassword@URL/BaseProj/ProjA/src/main/lib" it is working fine. I am able to get the dependency from the lib directory at my Personal laptop. But when i apply the same thing in my company project .. i am getting the error : Unable to find the dependency ..... What you think ? what would be the problem? Is it due to the expired certificate on svn server? What would be the case which restrict me from getting the dependency from svn? Any help will be highly appreciated.. – pradeep Dec 13 '11 at 20:50