diff options
Diffstat (limited to 'server')
12 files changed, 104 insertions, 45 deletions
diff --git a/server/sonar-process-monitor/pom.xml b/server/sonar-process-monitor/pom.xml index 81b6d12dbad..3821fcd21ca 100644 --- a/server/sonar-process-monitor/pom.xml +++ b/server/sonar-process-monitor/pom.xml @@ -79,4 +79,21 @@ </plugin> </plugins> </build> + + <profiles> + <profile> + <id>release</id> + <build> + <plugins> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> + </project> diff --git a/server/sonar-process/pom.xml b/server/sonar-process/pom.xml index 193ef735f13..c104542554e 100644 --- a/server/sonar-process/pom.xml +++ b/server/sonar-process/pom.xml @@ -96,4 +96,21 @@ </plugins> </build> + + <profiles> + <profile> + <id>release</id> + <build> + <plugins> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> + </project> diff --git a/server/sonar-search/pom.xml b/server/sonar-search/pom.xml index 9f15d8a8125..80a1259ad41 100644 --- a/server/sonar-search/pom.xml +++ b/server/sonar-search/pom.xml @@ -67,4 +67,21 @@ </plugin> </plugins> </build> + + <profiles> + <profile> + <id>release</id> + <build> + <plugins> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> + </project> diff --git a/server/sonar-server-benchmarks/pom.xml b/server/sonar-server-benchmarks/pom.xml index ea9d4615f23..e297807cad8 100644 --- a/server/sonar-server-benchmarks/pom.xml +++ b/server/sonar-server-benchmarks/pom.xml @@ -99,34 +99,13 @@ </profile> <profile> <id>release</id> - <activation><activeByDefault>false</activeByDefault></activation> <build> <plugins> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <executions> - <execution> - <id>empty-javadoc-jar</id> - <phase>package</phase> - <goals> - <goal>jar</goal> - </goals> - <configuration> - <classifier>javadoc</classifier> - </configuration> - </execution> - <execution> - <id>empty-sources-jar</id> - <phase>package</phase> - <goals> - <goal>jar</goal> - </goals> - <configuration> - <classifier>sources</classifier> - </configuration> - </execution> - </executions> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> </plugin> </plugins> </build> diff --git a/server/sonar-server/pom.xml b/server/sonar-server/pom.xml index b0ed4d4e4fd..7fb49bddfb1 100644 --- a/server/sonar-server/pom.xml +++ b/server/sonar-server/pom.xml @@ -337,6 +337,19 @@ </dependency> </dependencies> </profile> + <profile> + <id>release</id> + <build> + <plugins> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + </plugins> + </build> + </profile> </profiles> diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputeQProfileMeasureStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputeQProfileMeasureStep.java index 3495abce8e4..bd22aeb4d6d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputeQProfileMeasureStep.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputeQProfileMeasureStep.java @@ -24,7 +24,6 @@ import com.google.common.base.Optional; import java.util.HashMap; import java.util.Map; import org.sonar.api.measures.CoreMetrics; -import org.sonar.api.utils.MessageException; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.CrawlerDepthLimit; import org.sonar.server.computation.component.PathAwareCrawler; @@ -78,11 +77,6 @@ public class ComputeQProfileMeasureStep implements ComputationStep { @Override public void visitProject(Component project, Path<QProfiles> path) { addMeasure(project, path.current()); - Optional<Measure> qProfileMeasure = measureRepository.getRawMeasure(project, qProfilesMetric); - if (!qProfileMeasure.isPresent() || QPMeasureData.fromJson(qProfileMeasure.get().getData()).getProfiles().isEmpty()) { - throw MessageException.of(String.format("No quality profiles has been found on project '%s', you probably don't have any language plugin suitable for this analysis.", - project.getKey())); - } } @Override diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityProfileEventsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityProfileEventsStep.java index 6a8bd53a219..1967ec3eb92 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityProfileEventsStep.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityProfileEventsStep.java @@ -89,7 +89,8 @@ public class QualityProfileEventsStep implements ComputationStep { // Load base profiles Optional<Measure> rawMeasure = measureRepository.getRawMeasure(projectComponent, metricRepository.getByKey(CoreMetrics.QUALITY_PROFILES_KEY)); if (!rawMeasure.isPresent()) { - throw new IllegalStateException("Missing measure " + CoreMetrics.QUALITY_PROFILES + " for component " + projectComponent.getReportAttributes().getRef()); + // No qualify profile computed on the project + return; } Map<String, QualityProfile> rawProfiles = QPMeasureData.fromJson(rawMeasure.get().getStringValue()).getProfilesByKey(); diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileExporters.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileExporters.java index 47ba77634fb..d1e003aadc4 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileExporters.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileExporters.java @@ -63,6 +63,23 @@ public class QProfileExporters { this.importers = importers; } + /** + * Used by Pico if no {@link ProfileImporter} is found + */ + public QProfileExporters(QProfileLoader loader, RuleFinder ruleFinder, RuleActivator ruleActivator, ProfileExporter[] exporters) { + this(loader, ruleFinder, ruleActivator, exporters, new ProfileImporter[0]); + } + + /** + * Used by Pico if no {@link ProfileExporter} is found + */ + public QProfileExporters(QProfileLoader loader, RuleFinder ruleFinder, RuleActivator ruleActivator, ProfileImporter[] importers) { + this(loader, ruleFinder, ruleActivator, new ProfileExporter[0], importers); + } + + /** + * Used by Pico if no {@link ProfileImporter} nor {@link ProfileExporter} is found + */ public QProfileExporters(QProfileLoader loader, RuleFinder ruleFinder, RuleActivator ruleActivator) { this(loader, ruleFinder, ruleActivator, new ProfileExporter[0], new ProfileImporter[0]); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ExportersAction.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ExportersAction.java index 0196729e592..5dc2d180d40 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ExportersAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ExportersAction.java @@ -33,6 +33,9 @@ public class ExportersAction implements QProfileWsAction { this.exporters = exporters; } + /** + * Used by Pico is no {@link ProfileExporter} is found + */ public ExportersAction() { this(new ProfileExporter[0]); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputeQProfileMeasureStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputeQProfileMeasureStepTest.java index 354c4e8b2ad..45acfd592ee 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputeQProfileMeasureStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputeQProfileMeasureStepTest.java @@ -27,7 +27,6 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.sonar.api.utils.MessageException; import org.sonar.server.computation.batch.TreeRootHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.ReportComponent; @@ -136,10 +135,7 @@ public class ComputeQProfileMeasureStepTest { } @Test - public void fail_with_message_exception_when_no_qprofile_computed_on_project() throws Exception { - thrown.expect(MessageException.class); - thrown.expectMessage("No quality profiles has been found on project 'PROJECT KEY'"); - + public void nothing_to_add_when_no_qprofile_computed_on_project() throws Exception { treeRootHolder.setRoot(MULTI_MODULE_PROJECT); underTest.execute(); @@ -148,10 +144,7 @@ public class ComputeQProfileMeasureStepTest { } @Test - public void fail_with_message_exception_when_qprofiles_computed_on_project_are_empty() throws Exception { - thrown.expect(MessageException.class); - thrown.expectMessage("No quality profiles has been found on project 'PROJECT KEY', you probably don't have any language plugin suitable for this analysis."); - + public void nothing_to_add_when_qprofiles_computed_on_project_are_empty() throws Exception { treeRootHolder.setRoot(MULTI_MODULE_PROJECT); measureRepository.addRawMeasure(PROJECT_REF, QUALITY_PROFILES_KEY, newMeasureBuilder().create(toJson())); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityProfileEventsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityProfileEventsStepTest.java index ac4b52ea09c..7bcf0e0a658 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityProfileEventsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityProfileEventsStepTest.java @@ -89,7 +89,7 @@ public class QualityProfileEventsStepTest { } @Test - public void no_effect_if_no_base_measure() { + public void no_event_if_no_base_measure() { when(measureRepository.getBaseMeasure(treeRootHolder.getRoot(), qualityProfileMetric)).thenReturn(Optional.<Measure>absent()); underTest.execute(); @@ -97,16 +97,18 @@ public class QualityProfileEventsStepTest { verifyNoMoreInteractions(eventRepository); } - @Test(expected = IllegalStateException.class) - public void ISE_if_no_raw_measure() { + @Test + public void no_event_if_no_raw_measure() { when(measureRepository.getBaseMeasure(treeRootHolder.getRoot(), qualityProfileMetric)).thenReturn(Optional.of(newMeasure())); when(measureRepository.getRawMeasure(treeRootHolder.getRoot(), qualityProfileMetric)).thenReturn(Optional.<Measure>absent()); underTest.execute(); + + verifyNoMoreInteractions(eventRepository); } @Test - public void no_event_if_no_base_nor_row_QualityProfile_measure() { + public void no_event_if_no_base_and_quality_profile_measure_is_empty() { mockMeasures(treeRootHolder.getRoot(), null, null); underTest.execute(); diff --git a/server/sonar-web/pom.xml b/server/sonar-web/pom.xml index 092da6be892..6c74b1db15e 100644 --- a/server/sonar-web/pom.xml +++ b/server/sonar-web/pom.xml @@ -229,6 +229,12 @@ </execution> </executions> </plugin> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> </plugins> </build> <dependencies> |