@Test public void shouldNotFailWithoutDistributionManagement() throws Exception { BanDistributionManagement rule = setupProjectWithoutDistributionManagement(); rule.execute( helper ); }
@Override public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { logger = helper.getLog(); try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); if ( project.isExecutionRoot() ) { if ( project.getParent() == null ) { logger.debug( "We have no parent and in the root of a build we don't check anything," ); logger.debug( "because that is the location where we defined maven-enforcer-plugin." ); } else { logger.debug( "We are in the root of the execution and we have a parent." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } else { logger.debug( "We are in a deeper level." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( e.getMessage(), e ); } }
BanDistributionManagement extends AbstractNonCacheableEnforcerRule { @Override public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { logger = helper.getLog(); try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); if ( project.isExecutionRoot() ) { if ( project.getParent() == null ) { logger.debug( "We have no parent and in the root of a build we don't check anything," ); logger.debug( "because that is the location where we defined maven-enforcer-plugin." ); } else { logger.debug( "We are in the root of the execution and we have a parent." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } else { logger.debug( "We are in a deeper level." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( e.getMessage(), e ); } } }
BanDistributionManagement extends AbstractNonCacheableEnforcerRule { @Override public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { logger = helper.getLog(); try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); if ( project.isExecutionRoot() ) { if ( project.getParent() == null ) { logger.debug( "We have no parent and in the root of a build we don't check anything," ); logger.debug( "because that is the location where we defined maven-enforcer-plugin." ); } else { logger.debug( "We are in the root of the execution and we have a parent." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } else { logger.debug( "We are in a deeper level." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( e.getMessage(), e ); } }  }
BanDistributionManagement extends AbstractNonCacheableEnforcerRule { @Override public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { logger = helper.getLog(); try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); if ( project.isExecutionRoot() ) { if ( project.getParent() == null ) { logger.debug( "We have no parent and in the root of a build we don't check anything," ); logger.debug( "because that is the location where we defined maven-enforcer-plugin." ); } else { logger.debug( "We are in the root of the execution and we have a parent." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } else { logger.debug( "We are in a deeper level." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( e.getMessage(), e ); } }  @Override void execute( EnforcerRuleHelper helper ); boolean isAllowRepository(); void setAllowRepository( boolean allowRepository ); boolean isAllowSnapshotRepository(); void setAllowSnapshotRepository( boolean allowSnapshotRepository ); boolean isAllowSite(); void setAllowSite( boolean allowSite ); }
BanDistributionManagement extends AbstractNonCacheableEnforcerRule { @Override public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException { logger = helper.getLog(); try { MavenProject project = (MavenProject) helper.evaluate( "${project}" ); if ( project.isExecutionRoot() ) { if ( project.getParent() == null ) { logger.debug( "We have no parent and in the root of a build we don't check anything," ); logger.debug( "because that is the location where we defined maven-enforcer-plugin." ); } else { logger.debug( "We are in the root of the execution and we have a parent." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } else { logger.debug( "We are in a deeper level." ); DistributionManagementCheck check = new DistributionManagementCheck( project ); check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() ); } } catch ( ExpressionEvaluationException e ) { throw new EnforcerRuleException( e.getMessage(), e ); } }  @Override void execute( EnforcerRuleHelper helper ); boolean isAllowRepository(); void setAllowRepository( boolean allowRepository ); boolean isAllowSnapshotRepository(); void setAllowSnapshotRepository( boolean allowSnapshotRepository ); boolean isAllowSite(); void setAllowSite( boolean allowSite );  }