1 package org.apache.maven.project; 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 java.io.File; 23 24 /** 25 * Exception that occurs when the project list contains duplicate projects instead of ignoring one. 26 * 27 * @author <a href="mailto:brett@apache.org">Brett Porter</a> 28 * @version $Id: DuplicateProjectException.java 958295 2010-06-26 23:16:18Z hboutemy $ 29 */ 30 public class DuplicateProjectException 31 extends Exception 32 { 33 private final String projectId; 34 35 private final File existingProjectFile; 36 37 private final File conflictingProjectFile; 38 39 /** 40 * @deprecated use {@link #DuplicateProjectException(String, File, File, String)} 41 */ 42 public DuplicateProjectException( String message ) 43 { 44 this( null, null, null, message ); 45 } 46 47 /** 48 * @deprecated use {@link #DuplicateProjectException(String, File, File, String)} 49 */ 50 public DuplicateProjectException( String message, Exception e ) 51 { 52 super( message, e ); 53 this.projectId = null; 54 this.existingProjectFile = null; 55 this.conflictingProjectFile = null; 56 } 57 58 public DuplicateProjectException( String projectId, File existingProjectFile, File conflictingProjectFile, 59 String message ) 60 { 61 super( message ); 62 this.projectId = projectId; 63 this.existingProjectFile = existingProjectFile; 64 this.conflictingProjectFile = conflictingProjectFile; 65 } 66 67 public String getProjectId() 68 { 69 return projectId; 70 } 71 72 public File getExistingProjectFile() 73 { 74 return existingProjectFile; 75 } 76 77 public File getConflictingProjectFile() 78 { 79 return conflictingProjectFile; 80 } 81 }