View Javadoc

1   package org.apache.maven.archiva.dependency.graph;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.archiva.model.ArchivaProjectModel;
23  
24  /**
25   * DepManDeepVersionMemoryRepository
26   * 
27   * MemoryRepository for testing <code>net.example.depman.deepversion:A:1.0</code>
28   *
29   * @version $Id: DepManDeepVersionMemoryRepository.java 547277 2007-06-14 15:25:42Z joakime $
30   */
31  public class DepManDeepVersionMemoryRepository
32      extends AbstractMemoryRepository
33  {
34      public void initialize()
35      {
36          ArchivaProjectModel model;
37  
38          model = toModel( "net.example.depman.deepversion:A:1.0" );
39          model.addDependency( toDependency( "net.example.depman.deepversion:B:1.0::jar" ) );
40          model.addDependency( toDependency( "net.example.depman.deepversion:C:1.0::jar" ) );
41          model.addDependencyManagement( toDependency( "net.example.depman.deepversion:D:2.0::jar" ) );
42          addModel( model );
43          
44          /* Having a depman in A for D:2.0 will cause an orphaned E:2.0 during the depman
45           * application phase.
46           * 
47           * This is intentional, to test out the depman application and recovery.
48           */
49  
50          model = toModel( "net.example.depman.deepversion:B:1.0" );
51          model.addDependency( toDependency( "net.example.depman.deepversion:D:1.0::jar" ) );
52          addModel( model );
53  
54          model = toModel( "net.example.depman.deepversion:E:2.0" );
55          addModel( model );
56          
57          model = toModel( "net.example.depman.deepversion:E:3.0" );
58          model.addDependency( toDependency( "net.example.depman.deepversion:F:1.0::jar" ) );
59          addModel( model );
60          
61          model = toModel( "net.example.depman.deepversion:F:1.0" );
62          addModel( model );
63  
64          model = toModel( "net.example.depman.deepversion:C:1.0" );
65          model.addDependency( toDependency( "net.example.depman.deepversion:D:1.0::jar" ) );
66          addModel( model );
67  
68          model = toModel( "net.example.depman.deepversion:D:1.0" );
69          model.addDependency( toDependency( "net.example.depman.deepversion:E:2.0::jar" ) );
70          addModel( model );
71  
72          model = toModel( "net.example.depman.deepversion:D:2.0" );
73          model.addDependency( toDependency( "net.example.depman.deepversion:E:3.0::jar" ) );
74          addModel( model );
75  
76      }
77  }