Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MECLIPSE-1980: Update eclipse-commons to use the m2e@eclipse

  • Loading branch information...
commit 228ed23e237e746e39deff1148f4c673d1f145dd 1 parent 319f755
@vladt vladt authored
Showing with 2,788 additions and 44 deletions.
  1. +5 −26 eclipse-commons-parent/pom.xml
  2. +2 −2 org.maven.ide.eclipse.authentication.test/plugin.xml
  3. +1 −1  ...ation.test/src/org/maven/ide/eclipse/authentication/{TestURINormalizer.java → DummyURINormalizer.java}
  4. +1 −1  org.maven.ide.eclipse.authentication.test/src/org/maven/ide/eclipse/authentication/URIHelperTest.java
  5. +1 −1  org.maven.ide.eclipse.authentication/META-INF/MANIFEST.MF
  6. +24 −2 org.maven.ide.eclipse.io.test/pom.xml
  7. +1 −1  org.maven.ide.eclipse.io/META-INF/MANIFEST.MF
  8. +1 −1  org.maven.ide.eclipse.log/META-INF/MANIFEST.MF
  9. +1 −1  org.maven.ide.eclipse.log/plugin.xml
  10. +4 −4 org.maven.ide.eclipse.log/src/org/maven/ide/eclipse/log/internal/LogDataGatherer.java
  11. +1 −0  org.maven.ide.eclipse.pr/.gitignore
  12. +40 −0 org.maven.ide.eclipse.pr/META-INF/MANIFEST.MF
  13. +8 −0 org.maven.ide.eclipse.pr/OSGI-INF/l10n/bundle.properties
  14. +3 −0  org.maven.ide.eclipse.pr/apr/public-key.txt
  15. +22 −0 org.maven.ide.eclipse.pr/build.properties
  16. BIN  org.maven.ide.eclipse.pr/icons/report-bug.gif
  17. BIN  org.maven.ide.eclipse.pr/icons/report-wizard.gif
  18. BIN  org.maven.ide.eclipse.pr/jars/apache-mime4j-0.6.jar
  19. BIN  org.maven.ide.eclipse.pr/jars/commons-codec-1.4.jar
  20. BIN  org.maven.ide.eclipse.pr/jars/commons-logging-1.1.jar
  21. BIN  org.maven.ide.eclipse.pr/jars/httpclient-4.0.1.jar
  22. BIN  org.maven.ide.eclipse.pr/jars/httpcore-4.0.1.jar
  23. BIN  org.maven.ide.eclipse.pr/jars/httpmime-4.0.1.jar
  24. BIN  org.maven.ide.eclipse.pr/jars/log4j-1.2.8.jar
  25. BIN  org.maven.ide.eclipse.pr/jars/plexus-encryptor-1.0.jar
  26. BIN  org.maven.ide.eclipse.pr/jars/plexus-swizzle-1.3.jar
  27. BIN  org.maven.ide.eclipse.pr/jars/plexus-utils-1.5.4.jar
  28. BIN  org.maven.ide.eclipse.pr/jars/swizzle-jira-1.3.3.jar
  29. BIN  org.maven.ide.eclipse.pr/jars/swizzle-stream-1.0.2.jar
  30. BIN  org.maven.ide.eclipse.pr/jars/ws-commons-util-1.0.1.jar
  31. BIN  org.maven.ide.eclipse.pr/jars/xmlrpc-client-3.0.jar
  32. BIN  org.maven.ide.eclipse.pr/jars/xmlrpc-common-3.0.jar
  33. +24 −0 org.maven.ide.eclipse.pr/plugin.xml
  34. +110 −0 org.maven.ide.eclipse.pr/pom.xml
  35. +119 −0 org.maven.ide.eclipse.pr/schema/dataGatherers.exsd
  36. +37 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/IDataGatherer.java
  37. +36 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/IDataGatheringContext.java
  38. +41 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/IDataSource.java
  39. +31 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/IDataTarget.java
  40. +114 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/Messages.java
  41. +64 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/ProblemReportingImages.java
  42. +32 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/ProblemReportingMenuCreator.java
  43. +46 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/ProblemReportingPlugin.java
  44. +57 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/data/ArchiveTarget.java
  45. +151 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/data/Data.java
  46. +283 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/data/DataGatherer.java
  47. +62 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/data/DataGathererFactory.java
  48. +42 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/data/DataGatheringContext.java
  49. +43 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/messages.properties
  50. +127 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/ConfigurationDetailsSource.java
  51. +78 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/EffectivePomSource.java
  52. +109 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/ObfuscatedSettingsSource.java
  53. +73 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/StatusSource.java
  54. +49 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/TextConsoleSource.java
  55. +44 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/WorkspaceFileSource.java
  56. +50 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/wizard/HyperlinkDialog.java
  57. +221 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/wizard/ProblemDescriptionPage.java
  58. +69 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/wizard/ProblemReportingAction.java
  59. +252 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/wizard/ProblemReportingSelectionPage.java
  60. +253 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/wizard/ProblemReportingWizard.java
  61. +53 −0 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/sources/ExternalFileSource.java
  62. +1 −1  org.maven.ide.eclipse.ui.common.editor/META-INF/MANIFEST.MF
  63. +1 −1  org.maven.ide.eclipse.ui.common/META-INF/MANIFEST.MF
  64. +1 −2  pom.xml
View
31 eclipse-commons-parent/pom.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2008 Sonatype, Inc. All rights reserved. This program
and the accompanying materials are made available under the terms of
@@ -26,7 +25,6 @@
<properties>
<m2eclipse-core.version>0.13.0/N/0.13.0.201012141709</m2eclipse-core.version>
- <m2eclipse-core-sonatype.version>0.13.0/N/0.13.0.201012161635</m2eclipse-core-sonatype.version>
<tycho-version>0.9.0</tycho-version>
@@ -39,15 +37,16 @@
<layout>p2</layout>
<url>http://download.eclipse.org/releases/galileo</url>
</repository>
+ <!-- Required for org.slf4j -->
<repository>
- <id>m2e</id>
+ <id>orbit</id>
<layout>p2</layout>
- <url>http://repository.sonatype.org/content/sites/forge-sites/m2e/${m2eclipse-core.version}</url>
+ <url>http://download.eclipse.org/tools/orbit/downloads/drops/S20101014084557/repository</url>
</repository>
<repository>
- <id>m2e-sonatype</id>
+ <id>m2e</id>
<layout>p2</layout>
- <url>http://repository.sonatype.org/content/sites/forge-sites/m2e-sonatype/${m2eclipse-core-sonatype.version}</url>
+ <url>http://repository.sonatype.org/content/sites/forge-sites/m2e/${m2eclipse-core.version}</url>
</repository>
<repository>
@@ -90,26 +89,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.sonatype.http-testing-harness</groupId>
- <artifactId>junit-runner</artifactId>
- <version>0.3</version>
- </dependency>
- <dependency>
- <groupId>org.sonatype.http-testing-harness</groupId>
- <artifactId>harness-runner</artifactId>
- <version>0.3</version>
- </dependency>
- <dependency>
- <groupId>org.sonatype.http-testing-harness</groupId>
- <artifactId>server-provider</artifactId>
- <version>0.3</version>
- </dependency>
- <dependency>
- <groupId>org.sonatype.http-testing-harness</groupId>
- <artifactId>hth-api</artifactId>
- <version>0.3</version>
- </dependency>
</dependencies>
<pluginRepositories>
View
4 org.maven.ide.eclipse.authentication.test/plugin.xml
@@ -12,11 +12,11 @@
</extension>
<extension
- id="org.maven.ide.eclipse.authentication.TestURINormalizer"
+ id="org.maven.ide.eclipse.authentication.DummyURINormalizer"
name="URI Normalizer for unit tests"
point="org.maven.ide.eclipse.authentication.URINormalizer">
<handler
- class="org.maven.ide.eclipse.authentication.TestURINormalizer">
+ class="org.maven.ide.eclipse.authentication.DummyURINormalizer">
</handler>
</extension>
</plugin>
View
2  ...pse/authentication/TestURINormalizer.java → ...se/authentication/DummyURINormalizer.java
@@ -1,6 +1,6 @@
package org.maven.ide.eclipse.authentication;
-public class TestURINormalizer
+public class DummyURINormalizer
implements IURINormalizer
{
public static final String URI_PREFIX = "unittest:";
View
2  ...e.eclipse.authentication.test/src/org/maven/ide/eclipse/authentication/URIHelperTest.java
@@ -11,7 +11,7 @@ public void testURINormalizers()
{
String sUri = "http://foo";
assertEquals( sUri, URIHelper.normalize( sUri ).toString() );
- assertEquals( sUri, URIHelper.normalize( TestURINormalizer.URI_PREFIX + sUri ).toString() );
+ assertEquals( sUri, URIHelper.normalize( DummyURINormalizer.URI_PREFIX + sUri ).toString() );
}
public void testRemoveScmPrefix()
View
2  org.maven.ide.eclipse.authentication/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@ Bundle-Version: 1.1.7.qualifier
Bundle-Vendor: Sonatype, Inc.
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
-Import-Package: org.slf4j;version="[1.5,1.6)"
+Import-Package: org.slf4j;version="[1.5,1.7)"
Export-Package: org.maven.ide.eclipse.authentication,
org.maven.ide.eclipse.authentication.internal,
org.maven.ide.eclipse.authentication.internal.storage
View
26 org.maven.ide.eclipse.io.test/pom.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -14,6 +13,29 @@
<artifactId>org.maven.ide.eclipse.io.test</artifactId>
<packaging>eclipse-test-plugin</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.sonatype.http-testing-harness</groupId>
+ <artifactId>junit-runner</artifactId>
+ <version>0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.http-testing-harness</groupId>
+ <artifactId>harness-runner</artifactId>
+ <version>0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.http-testing-harness</groupId>
+ <artifactId>server-provider</artifactId>
+ <version>0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.http-testing-harness</groupId>
+ <artifactId>hth-api</artifactId>
+ <version>0.3</version>
+ </dependency>
+ </dependencies>
+
<build>
<plugins>
<plugin>
View
2  org.maven.ide.eclipse.io/META-INF/MANIFEST.MF
@@ -10,7 +10,7 @@ Require-Bundle: org.eclipse.core.runtime,
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
Bundle-ActivationPolicy: lazy
-Import-Package: org.slf4j;version="[1.5,1.6)"
+Import-Package: org.slf4j;version="[1.5,1.7)"
Export-Package: org.maven.ide.eclipse.io,
org.maven.ide.eclipse.io.internal
Bundle-Activator: org.maven.ide.eclipse.io.internal.S2IOPlugin
View
2  org.maven.ide.eclipse.log/META-INF/MANIFEST.MF
@@ -12,7 +12,7 @@ Bundle-ClassPath: .,
jars/logback-core-0.9.18.jar,
jars/logback-classic-0.9.18.jar
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.m2e.pr;resolution:=optional
+ org.maven.ide.eclipse.pr;resolution:=optional
Export-Package: org.maven.ide.eclipse.log,
org.maven.ide.eclipse.log.internal;x-internal:=true,
org.slf4j;provider=m2eclipse;version="1.5.10"
View
2  org.maven.ide.eclipse.log/plugin.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
- <extension point="org.eclipse.m2e.pr.dataGatherers">
+ <extension point="org.maven.ide.eclipse.pr.dataGatherers">
<gatherer class="org.maven.ide.eclipse.log.internal.LogDataGatherer"/>
</extension>
</plugin>
View
8 org.maven.ide.eclipse.log/src/org/maven/ide/eclipse/log/internal/LogDataGatherer.java
@@ -3,10 +3,10 @@
import java.io.File;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.m2e.pr.IDataGatherer;
-import org.eclipse.m2e.pr.IDataGatheringContext;
-import org.eclipse.m2e.pr.IDataTarget;
-import org.eclipse.m2e.pr.sources.ExternalFileSource;
+import org.maven.ide.eclipse.pr.IDataGatherer;
+import org.maven.ide.eclipse.pr.IDataGatheringContext;
+import org.maven.ide.eclipse.pr.IDataTarget;
+import org.maven.ide.eclipse.pr.sources.ExternalFileSource;
public class LogDataGatherer
implements IDataGatherer
View
1  org.maven.ide.eclipse.pr/.gitignore
@@ -0,0 +1 @@
+/target
View
40 org.maven.ide.eclipse.pr/META-INF/MANIFEST.MF
@@ -0,0 +1,40 @@
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.ui,
+ org.eclipse.ui.console,
+ org.eclipse.jface.text,
+ org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.core;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.jdt.core,
+ org.eclipse.ui.ide,
+ com.ibm.icu;bundle-version="4.0.1"
+Bundle-Vendor: %Bundle-Vendor
+Bundle-ClassPath: jars/apache-mime4j-0.6.jar,
+ jars/commons-codec-1.4.jar,
+ jars/commons-logging-1.1.jar,
+ jars/httpclient-4.0.1.jar,
+ jars/httpcore-4.0.1.jar,
+ jars/httpmime-4.0.1.jar,
+ jars/log4j-1.2.8.jar,
+ jars/plexus-utils-1.5.4.jar,
+ jars/swizzle-jira-1.3.3.jar,
+ jars/swizzle-stream-1.0.2.jar,
+ jars/ws-commons-util-1.0.1.jar,
+ jars/xmlrpc-client-3.0.jar,
+ jars/xmlrpc-common-3.0.jar,
+ .,
+ jars/plexus-swizzle-1.3.jar,
+ jars/plexus-encryptor-1.0.jar
+MavenArtifact-BaseVersion: 0.10.0-SNAPSHOT
+Bundle-Version: 1.1.7.qualifier
+MavenArtifact-ArtifactId: org.maven.ide.eclipse.pr
+MavenArtifact-GroupId: org.maven.ide.eclipse.commons
+Bundle-Name: %Bundle-Name
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.maven.ide.eclipse.pr;singleton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
+Export-Package: org.maven.ide.eclipse.pr,
+ org.maven.ide.eclipse.pr.internal.data;x-friends:="org.eclipse.m2e.pr.tests",
+ org.maven.ide.eclipse.pr.sources
+
View
8 org.maven.ide.eclipse.pr/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,8 @@
+#Properties file for org.maven.ide.eclipse.pr
+Bundle-Vendor = Eclipse m2e
+Bundle-Name = Maven Problem Reporting
+actionSet.description = Maven Problem Reporting
+actionSet.label = Maven Problem Reporting
+action.label = Report Maven Issue...
+action.tooltip = Report Maven Issue
+extension-point.name = Maven Problem Reporting Data Gatherer
View
3  org.maven.ide.eclipse.pr/apr/public-key.txt
@@ -0,0 +1,3 @@
+MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdEw7B2+WBE74aQ6XCLjuhYXsKIjoxt0VGlty9
+kw8OwLmlOvvaQwN+bwro2x1T+bs4MtTlqsnGc2Ir7rLttndQtBPa6ZSm1jHa+v2426UBtACPn3Mi
+SN8t/kZRTuU+pUYD+SPTDRX2URuQ9fcmJrdKrSBo7B88Xstt9kBLf70CwQIDAQAB
View
22 org.maven.ide.eclipse.pr/build.properties
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2008-2010 Sonatype, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+bin.includes = plugin.xml,\
+ jars/,\
+ icons/,\
+ schema/,\
+ apr/,\
+ META-INF/,\
+ .,\
+ OSGI-INF/l10n/bundle.properties
+jars.compile.order = .
+output.. = target/classes/
+source.. = src/
View
BIN  org.maven.ide.eclipse.pr/icons/report-bug.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  org.maven.ide.eclipse.pr/icons/report-wizard.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  org.maven.ide.eclipse.pr/jars/apache-mime4j-0.6.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/commons-codec-1.4.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/commons-logging-1.1.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/httpclient-4.0.1.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/httpcore-4.0.1.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/httpmime-4.0.1.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/log4j-1.2.8.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/plexus-encryptor-1.0.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/plexus-swizzle-1.3.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/plexus-utils-1.5.4.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/swizzle-jira-1.3.3.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/swizzle-stream-1.0.2.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/ws-commons-util-1.0.1.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/xmlrpc-client-3.0.jar
Binary file not shown
View
BIN  org.maven.ide.eclipse.pr/jars/xmlrpc-common-3.0.jar
Binary file not shown
View
24 org.maven.ide.eclipse.pr/plugin.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="dataGatherers" name="%extension-point.name" schema="schema/dataGatherers.exsd"/>
+
+ <extension point="org.eclipse.m2e.core.m2menu">
+ <factory class="org.maven.ide.eclipse.pr.internal.ProblemReportingMenuCreator"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.actionSets">
+ <actionSet id="org.eclipse.m2e.help.actionSet"
+ label="%actionSet.label"
+ description="%actionSet.description"
+ visible="true">
+ <action id="org.eclipse.m2e.help.report"
+ label="%action.label"
+ tooltip="%action.tooltip"
+ menubarPath="help/additions"
+ icon="icons/report-bug.gif"
+ class="org.maven.ide.eclipse.pr.internal.wizard.ProblemReportingAction"/>
+ </actionSet>
+ </extension>
+
+</plugin>
View
110 org.maven.ide.eclipse.pr/pom.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2008 Sonatype, Inc.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.maven.ide.eclipse.commons</groupId>
+ <artifactId>eclipse-commons-parent</artifactId>
+ <version>1.1.7-SNAPSHOT</version>
+ <relativePath>../eclipse-commons-parent</relativePath>
+ </parent>
+
+ <artifactId>org.maven.ide.eclipse.pr</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <name>Maven Problem Reporting</name>
+
+ <profiles>
+ <profile>
+ <id>update-dependencies</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.sonatype.spice</groupId>
+ <artifactId>plexus-swizzle</artifactId>
+ <version>1.0-alpha-1</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>swizzle-jirareport</artifactId>
+ <groupId>org.codehaus.swizzle</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>plexus-utils</artifactId>
+ <groupId>org.codehaus.plexus</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>plexus-container-default</artifactId>
+ <groupId>org.codehaus.plexus</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>plexus-component-annotations</artifactId>
+ <groupId>org.codehaus.plexus</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>plexus-classworlds</artifactId>
+ <groupId>org.codehaus.plexus</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>xml-apis</artifactId>
+ <groupId>xml-apis</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>jars</directory>
+ <followSymlinks>false</followSymlinks>
+ <includes>
+ <include>**/*.jar</include>
+ </includes>
+ </fileset>
+ <fileset>
+ <directory>META-INF</directory>
+ <followSymlinks>false</followSymlinks>
+ <includes>
+ <include>**/MANIFEST.MF</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-packaging-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>generate-bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <packageSources>false</packageSources>
+ <manifestAttributes>
+ <Bundle-RequiredExecutionEnvironment>J2SE-1.5,JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
+ <Require-Bundle>org.eclipse.core.runtime,org.eclipse.core.resources, org.eclipse.ui,org.eclipse.ui.console, org.eclipse.jface.text, org.eclipse.m2e.maven.runtime, org.eclipse.m2e.core</Require-Bundle>
+ </manifestAttributes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
View
119 org.maven.ide.eclipse.pr/schema/dataGatherers.exsd
@@ -0,0 +1,119 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.maven.ide.eclipse.pr" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.maven.ide.eclipse.pr" id="dataGatherers" name="Maven Problem Reporting Data Gatherer"/>
+ </appInfo>
+ <documentation>
+ Maven Problem Reporting Data Gatherer
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="gatherer" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="gatherer">
+ <annotation>
+ <documentation>
+ Data Gatherer
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Java class name for data gatherer implementation.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.maven.ide.eclipse.pr.IDataGatherer"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.9.9
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2007, 2008 Sonatype, Inc.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+ </documentation>
+ </annotation>
+
+</schema>
View
37 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/IDataGatherer.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr;
+
+import org.eclipse.core.runtime.CoreException;
+
+
+/**
+ * Gathers data to be included in an issue report.
+ */
+public interface IDataGatherer {
+
+ /**
+ * Gets tne name of this data gatherer.
+ *
+ * @return The name of this gatherer, never {@code null}.
+ */
+ String getName();
+
+ /**
+ * Gathers data to be included in an issue report.
+ *
+ * @param context The data gathering context for the issue report, must not be {@code null}.
+ * @throws CoreException If the data gathering failed for any reason.
+ */
+ void gather(IDataGatheringContext context) throws CoreException;
+
+}
View
36 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/IDataGatheringContext.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+
+/**
+ * Describes the context of data gathering for an issue report.
+ */
+public interface IDataGatheringContext {
+
+ /**
+ * Gets the target for the gathered data.
+ *
+ * @return The target for the gathered data, never {@code null}.
+ */
+ IDataTarget getTarget();
+
+ /**
+ * Gets the progress monitor to use.
+ *
+ * @return The progress monitor, never {@code null}.
+ */
+ IProgressMonitor getMonitor();
+
+}
View
41 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/IDataSource.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * A data source wraps some object or method, and returns an InputStream
+ * representing the contents of that object or method.
+ */
+public interface IDataSource {
+
+ /**
+ * Get an InputStream representing the wrapped object's contents.
+ * @return the InputStream
+ * @throws IOException
+ * @throws CoreException
+ */
+ InputStream getInputStream() throws CoreException;
+
+ /**
+ * Some implementations (e.g. a source that wraps a file in the file system)
+ * can return an appropriate name (e.g the file name).
+ *
+ * @return a name
+ */
+ String getName();
+
+}
View
31 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/IDataTarget.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr;
+
+import org.eclipse.core.runtime.CoreException;
+
+
+/**
+ * A data target knows how to consume a data source, recording the result under
+ * the specified name.
+ */
+public interface IDataTarget {
+
+ /**
+ * Consume the data, storing the data under the specified name.
+ *
+ * @param folderName a folder name to save data
+ * @param source the source of the data
+ */
+ void consume(String folderName, IDataSource source) throws CoreException;
+
+}
View
114 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/Messages.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * @author mkleint
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.maven.ide.eclipse.pr.internal.messages"; //$NON-NLS-1$
+
+ public static String ConfigurationDetailsSource_date;
+
+ public static String ConfigurationDetailsSource_error;
+
+ public static String Data_console;
+
+ public static String Data_eclipse_config;
+
+ public static String Data_global_settings;
+
+ public static String Data_project_files;
+
+ public static String Data_project_sources;
+
+ public static String Data_user_settings;
+
+ public static String DataGatherer_error;
+
+ public static String DataGatherer_monitor_encrypting;
+
+ public static String DataGatherer_monitor_gather;
+
+ public static String EffectivePomSource_error1;
+
+ public static String EffectivePomSource_error2;
+
+ public static String EffectivePomSource_error3;
+
+ public static String ProblemDescriptionPage_btnScreenshot;
+
+ public static String ProblemDescriptionPage_description;
+
+ public static String ProblemDescriptionPage_error_empty_desc;
+
+ public static String ProblemDescriptionPage_error_empty_summary;
+
+ public static String ProblemDescriptionPage_error_empty_summary_desc;
+
+ public static String ProblemDescriptionPage_lblDesc;
+
+ public static String ProblemDescriptionPage_lblLink;
+
+ public static String ProblemDescriptionPage_lblProjects;
+
+ public static String ProblemDescriptionPage_lblSummary;
+
+ public static String ProblemDescriptionPage_title;
+
+ public static String ProblemReportingMenuCreator_action_report;
+ public static String ProblemReportingSelectionPage_btnBrowse;
+
+ public static String ProblemReportingSelectionPage_btnConsole;
+
+ public static String ProblemReportingSelectionPage_btnEclipseConfig;
+
+ public static String ProblemReportingSelectionPage_btnErrorLog;
+
+ public static String ProblemReportingSelectionPage_btnExportAll;
+
+ public static String ProblemReportingSelectionPage_btnGlobalSettings;
+
+ public static String ProblemReportingSelectionPage_btnPomFiles;
+
+ public static String ProblemReportingSelectionPage_btnSources;
+
+ public static String ProblemReportingSelectionPage_btnUserSettings;
+
+ public static String ProblemReportingSelectionPage_desc;
+
+ public static String ProblemReportingSelectionPage_fileDialog_text;
+
+ public static String ProblemReportingSelectionPage_lblLocation;
+
+ public static String ProblemReportingSelectionPage_title;
+ public static String ProblemReportingWizard_job_gathering;
+
+ public static String ProblemReportingWizard_link_success;
+
+ public static String ProblemReportingWizard_monitor_reading;
+
+ public static String ProblemReportingWizard_title;
+
+ public static String ProblemReportingWizard_window_title;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
View
64 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/ProblemReportingImages.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class ProblemReportingImages {
+
+ // images
+
+ // public static final Image IMG_REPORT = createImage("clear.gif");
+
+ // image descriptors
+
+ public static final ImageDescriptor REPORT_BUG = create("report-bug.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor REPORT_WIZARD = create("report-wizard.gif"); //$NON-NLS-1$
+
+
+ private static ImageDescriptor create(String key) {
+ try {
+ ImageDescriptor imageDescriptor = createDescriptor(key);
+ ImageRegistry imageRegistry = getImageRegistry();
+ if(imageRegistry!=null) {
+ imageRegistry.put(key, imageDescriptor);
+ }
+ return imageDescriptor;
+ } catch (Exception ex) {
+ MavenLogger.log(key, ex);
+ return null;
+ }
+ }
+
+// private static Image createImage(String key) {
+// create(key);
+// ImageRegistry imageRegistry = getImageRegistry();
+// return imageRegistry==null ? null : imageRegistry.get(key);
+// }
+
+ private static ImageRegistry getImageRegistry() {
+ ProblemReportingPlugin plugin = ProblemReportingPlugin.getDefault();
+ return plugin==null ? null : plugin.getImageRegistry();
+ }
+
+ private static ImageDescriptor createDescriptor(String image) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(ProblemReportingPlugin.PLUGIN_ID, "icons/" + image); //$NON-NLS-1$
+ }
+
+}
View
32 ...ven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/ProblemReportingMenuCreator.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.m2e.core.actions.AbstractMavenMenuCreator;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.maven.ide.eclipse.pr.internal.wizard.ProblemReportingAction;
+
+
+public class ProblemReportingMenuCreator extends AbstractMavenMenuCreator {
+
+ public void createMenu(IMenuManager mgr) {
+ int selectionType = SelectionUtil.getSelectionType(selection);
+ if(selectionType == SelectionUtil.PROJECT_WITH_NATURE || selectionType == SelectionUtil.PROJECT_WITHOUT_NATURE) {
+ mgr.appendToGroup(IMPORT, new Separator()); //
+ mgr.appendToGroup(IMPORT, getAction(new ProblemReportingAction(), //
+ ProblemReportingAction.ID, Messages.ProblemReportingMenuCreator_action_report, ProblemReportingImages.REPORT_BUG));
+ }
+ }
+
+}
View
46 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/ProblemReportingPlugin.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ */
+public class ProblemReportingPlugin extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "org.maven.ide.eclipse.pr"; //$NON-NLS-1$
+
+ // The shared instance
+ private static ProblemReportingPlugin instance;
+
+ public static ProblemReportingPlugin getDefault() {
+ return instance;
+ }
+
+ public ProblemReportingPlugin() {
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ instance = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ instance = null;
+ }
+
+}
View
57 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/data/ArchiveTarget.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.data;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import org.codehaus.plexus.util.IOUtil;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.maven.ide.eclipse.pr.IDataSource;
+import org.maven.ide.eclipse.pr.IDataTarget;
+import org.maven.ide.eclipse.pr.internal.ProblemReportingPlugin;
+
+
+/**
+ * This target knows how to write contents to a folder in the workspace.
+ */
+public class ArchiveTarget implements IDataTarget {
+
+ private final ZipOutputStream zos;
+
+ public ArchiveTarget(ZipOutputStream zos) {
+ this.zos = zos;
+ }
+
+ public void consume(String folderName, IDataSource source) throws CoreException {
+ InputStream is = null;
+ try {
+ is = source.getInputStream();
+ if(is != null) {
+ ZipEntry entry = new ZipEntry(folderName + "/" + source.getName()); //$NON-NLS-1$
+ entry.setMethod(ZipEntry.DEFLATED);
+ zos.putNextEntry(entry);
+ IOUtil.copy(is, zos);
+ }
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, ProblemReportingPlugin.PLUGIN_ID, -1, ex.getMessage(), ex));
+ } finally {
+ IOUtil.close(is);
+ }
+
+ }
+
+}
View
151 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/data/Data.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.data;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.cli.MavenCli;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.maven.ide.eclipse.pr.IDataTarget;
+import org.maven.ide.eclipse.pr.internal.Messages;
+import org.maven.ide.eclipse.pr.internal.sources.ConfigurationDetailsSource;
+import org.maven.ide.eclipse.pr.internal.sources.EffectivePomSource;
+import org.maven.ide.eclipse.pr.internal.sources.ObfuscatedSettingsSource;
+import org.maven.ide.eclipse.pr.internal.sources.TextConsoleSource;
+import org.maven.ide.eclipse.pr.internal.sources.WorkspaceFileSource;
+import org.maven.ide.eclipse.pr.sources.ExternalFileSource;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public enum Data {
+
+ MAVEN_USER_SETTINGS(Messages.Data_user_settings) {
+ public void gather(DataGatherer gatherer, IDataTarget target, IProgressMonitor monitor) {
+ String settings = gatherer.getMavenConfiguration().getUserSettingsFile();
+ if(settings==null || settings.trim().length() == 0) {
+ settings = MavenCli.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath();
+ }
+ gatherer.gather("config", target, new ObfuscatedSettingsSource(settings, "user-settings.xml")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // TODO user profiles and toolchain
+ }
+ },
+
+ MAVEN_GLOBAL_SETTINGS(Messages.Data_global_settings) {
+ public void gather(DataGatherer gatherer, IDataTarget target, IProgressMonitor monitor) {
+ String settings = gatherer.getMavenConfiguration().getGlobalSettingsFile();
+ gatherer.gather("config", target, new ObfuscatedSettingsSource(settings, "global-settings.xml")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ },
+
+ MAVEN_CONSOLE(Messages.Data_console) {
+ public void gather(DataGatherer gatherer, IDataTarget target, IProgressMonitor monitor) {
+ gatherer.gather("config", target, new TextConsoleSource(gatherer.getConsole(), "mavenConsole.log")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ },
+
+ MAVEN_POM_FILES(Messages.Data_project_files) {
+ public void gather(DataGatherer gatherer, IDataTarget target, IProgressMonitor monitor) {
+ for(IProject project : gatherer.getProjects()) {
+ String folderName = "projects/" + project.getName(); //$NON-NLS-1$
+ if(project.isAccessible()) {
+ gatherer.gather(folderName, target, new WorkspaceFileSource(project.getFile("pom.xml"))); //$NON-NLS-1$
+ gatherer.gather(folderName, target, new WorkspaceFileSource(project.getFile("profiles.xml"))); //$NON-NLS-1$
+ gatherer.gather(folderName, target, new WorkspaceFileSource(project.getFile(".project"))); //$NON-NLS-1$
+ gatherer.gather(folderName, target, new WorkspaceFileSource(project.getFile(".classpath"))); //$NON-NLS-1$
+
+ gatherer.gather(folderName, target, //
+ new EffectivePomSource(gatherer.getProjectManager(), project.getFile("pom.xml"), monitor)); //$NON-NLS-1$
+ }
+ }
+ }
+ },
+
+ MAVEN_SOURCES(Messages.Data_project_sources) {
+ public void gather(final DataGatherer gatherer, final IDataTarget target, final IProgressMonitor monitor) {
+ Set<IProject> projectSet = gatherer.getProjects();
+ List<IProject> projects = new ArrayList<IProject>(projectSet);
+ for(IProject project : projectSet) {
+ IPath projectLocation = project.getLocation();
+ for(Iterator<IProject> it = projects.iterator(); it.hasNext();) {
+ IProject project2 = it.next();
+ if(project != project2 && projectLocation.isPrefixOf(project2.getLocation())) {
+ it.remove();
+ }
+ }
+ }
+
+ for(final IProject project : projects) {
+ if(project.isAccessible()) {
+ try {
+ project.accept(new IResourceVisitor() {
+ long t = System.currentTimeMillis();
+ public boolean visit(IResource resource) throws CoreException {
+ if((t - System.currentTimeMillis()) % 1000L == 0) {
+ monitor.subTask(resource.getFullPath().toOSString());
+ t = System.currentTimeMillis();
+ }
+ if(resource instanceof IFile) {
+ if(!resource.getName().endsWith(".class")) { //$NON-NLS-1$
+ gatherer.gather("projects" + resource.getParent().getFullPath(), target, // //$NON-NLS-1$
+ new WorkspaceFileSource((IFile) resource));
+ }
+ }
+ return true;
+ }
+ }, IResource.DEPTH_INFINITE, 0);
+ } catch(CoreException ex) {
+ gatherer.addStatus(ex.getStatus());
+ }
+ }
+ }
+ }
+ },
+
+ ECLIPSE_CONFIG(Messages.Data_eclipse_config) {
+ public void gather(DataGatherer gatherer, IDataTarget target, IProgressMonitor monitor) {
+ gatherer.gather("config", target, new ConfigurationDetailsSource()); //$NON-NLS-1$
+ }
+ },
+
+ ECLIPSE_LOG("Eclipse log") { //$NON-NLS-1$
+ public void gather(DataGatherer gatherer, IDataTarget target, IProgressMonitor monitor) {
+ String file = gatherer.getWorkspace().getRoot().getLocation().append(".metadata/.log").toOSString(); //$NON-NLS-1$
+ gatherer.gather("config", target, new ExternalFileSource(file, "error.log")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ };
+
+
+ private final String name;
+
+ private Data(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public abstract void gather(DataGatherer gatherer, IDataTarget target, IProgressMonitor monitor);
+
+}
View
283 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/data/DataGatherer.java
@@ -0,0 +1,283 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.data;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.security.GeneralSecurityException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
+import java.util.zip.ZipOutputStream;
+
+import org.codehaus.plexus.util.IOUtil;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.osgi.util.NLS;
+import org.maven.ide.eclipse.pr.IDataGatherer;
+import org.maven.ide.eclipse.pr.IDataSource;
+import org.maven.ide.eclipse.pr.IDataTarget;
+import org.maven.ide.eclipse.pr.internal.Messages;
+import org.maven.ide.eclipse.pr.internal.ProblemReportingPlugin;
+import org.maven.ide.eclipse.pr.internal.sources.StatusSource;
+import org.sonatype.plexus.encryptor.PlexusEncryptor;
+import org.sonatype.plexus.encryptor.RsaAesPlexusEncryptor;
+
+
+/**
+ * Gather various resources to aid in problem determination.
+ */
+public class DataGatherer {
+
+ private final IMavenConfiguration mavenConfiguration;
+
+ private final MavenProjectManager projectManager;
+
+ private final MavenConsole console;
+
+ private final IWorkspace workspace;
+
+ private final Set<IProject> projects;
+
+ private final List<IStatus> statuses = new ArrayList<IStatus>();
+
+ private final URL publicKey;
+
+ public DataGatherer(IMavenConfiguration mavenConfiguration, MavenProjectManager mavenProjectManager,
+ MavenConsole console, IWorkspace workspace, Set<IProject> projects, URL publicKey) {
+ this.mavenConfiguration = mavenConfiguration;
+ this.projectManager = mavenProjectManager;
+ this.console = console;
+ this.workspace = workspace;
+ this.projects = projects;
+ this.publicKey = publicKey;
+ }
+
+ public IMavenConfiguration getMavenConfiguration() {
+ return mavenConfiguration;
+ }
+
+ public MavenProjectManager getProjectManager() {
+ return projectManager;
+ }
+
+ public MavenConsole getConsole() {
+ return console;
+ }
+
+ public IWorkspace getWorkspace() {
+ return workspace;
+ }
+
+ public Set<IProject> getProjects() {
+ return projects;
+ }
+
+ public List<File> gather(File bundleDir, Set<Data> dataSet, IProgressMonitor monitor) throws IOException {
+ // project sources go into second bundle (if any), all the rest goes into first/primary bundle
+ List<File> bundleFiles = new ArrayList<File>();
+
+ List<IDataGatherer> dataGatherers = DataGathererFactory.getDataGatherers();
+
+ SubMonitor progress = SubMonitor.convert(monitor, Messages.DataGatherer_monitor_gather, dataSet.size() + dataGatherers.size() + 1);
+
+ // There's a size limit on JIRA attachments, so we split logs, config etc. from the project sources
+ Set<Data> set1 = EnumSet.copyOf(dataSet);
+ set1.remove(Data.MAVEN_SOURCES);
+ Set<Data> set2 = EnumSet.copyOf(dataSet);
+ set2.removeAll(set1);
+
+ try {
+ if(!set2.isEmpty()) {
+ File bundleFile = File.createTempFile("bundle", ".zip", bundleDir); //$NON-NLS-1$ //$NON-NLS-2$
+ bundleFiles.add(bundleFile);
+
+ gather(bundleFile, set2, Collections.<IDataGatherer> emptyList(), false, progress);
+
+ if(bundleFile.length() <= 0) {
+ bundleFile.delete();
+ bundleFiles.remove(bundleFile);
+ }
+ }
+
+ // primary bundle with the potential status logs is created last
+ {
+ File bundleFile = File.createTempFile("bundle", ".zip", bundleDir); //$NON-NLS-1$ //$NON-NLS-2$
+ bundleFiles.add(0, bundleFile);
+
+ gather(bundleFile, set1, dataGatherers, true, progress);
+ }
+ } catch(IOException e) {
+ for(File bundleFile : bundleFiles) {
+ bundleFile.delete();
+ }
+ throw e;
+ }
+
+ bundleFiles = encryptBundles(bundleFiles, bundleDir, progress.newChild(1));
+
+ progress.done();
+
+ return bundleFiles;
+ }
+
+ private void gather(File bundleFile, Set<Data> dataSet, List<IDataGatherer> dataGatherers, boolean status,
+ IProgressMonitor monitor) throws IOException {
+ ZipOutputStream zos = null;
+ try {
+ zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(bundleFile)));
+ IDataTarget target = new ArchiveTarget(zos);
+ gather(target, dataSet, dataGatherers, monitor);
+ if(status) {
+ gatherStatus(target);
+ }
+ zos.flush();
+ } finally {
+ IOUtil.close(zos);
+ }
+ }
+
+ private void gather(IDataTarget target, Set<Data> dataSet, List<IDataGatherer> dataGatherers, IProgressMonitor monitor) {
+ for(Data data : dataSet) {
+ try {
+ data.gather(this, target, monitor);
+ } catch(Exception e) {
+ addStatus(new Status(IStatus.ERROR, ProblemReportingPlugin.PLUGIN_ID,
+ NLS.bind(Messages.DataGatherer_error, e.getMessage()), e));
+ }
+ monitor.worked(1);
+ }
+
+ DataGatheringContext context = new DataGatheringContext(target, monitor);
+ for(IDataGatherer dataGatherer : dataGatherers) {
+ try {
+ dataGatherer.gather(context);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ addStatus(ex.getStatus());
+ } catch(Exception e) {
+ addStatus(new Status(IStatus.ERROR, ProblemReportingPlugin.PLUGIN_ID,
+ NLS.bind(Messages.DataGatherer_error, e.getMessage()), e));
+ }
+ monitor.worked(1);
+ }
+ }
+
+ void gather(String folderName, IDataTarget target, IDataSource source) {
+ try {
+ target.consume(folderName, source);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ addStatus(ex.getStatus());
+ } catch(Exception e) {
+ addStatus(new Status(IStatus.ERROR, ProblemReportingPlugin.PLUGIN_ID,
+ NLS.bind(Messages.DataGatherer_error, e.getMessage()), e));
+ }
+ }
+
+ private void gatherStatus(IDataTarget target) {
+ if(!statuses.isEmpty()) {
+ int index = 0;
+ for(IStatus status : statuses) {
+ try {
+ target.consume("pr", new StatusSource(status, "status-" + index + ".txt")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ } catch(Exception e) {
+ MavenLogger.log("Failed to save status to problem report", e); //$NON-NLS-1$
+ }
+ index++ ;
+ }
+ }
+ }
+
+ public void addStatus(IStatus status) {
+ statuses.add(status);
+ }
+
+ private List<File> encryptBundles(List<File> inputFiles, File bundleDir, IProgressMonitor monitor) throws IOException {
+ SubMonitor progress = SubMonitor.convert(monitor, Messages.DataGatherer_monitor_encrypting, inputFiles.size());
+
+ if(publicKey == null) {
+ return inputFiles;
+ }
+
+ List<File> bundleFiles = new ArrayList<File>();
+
+ PlexusEncryptor encryptor = new RsaAesPlexusEncryptor();
+
+ for(File input : inputFiles) {
+ File output = File.createTempFile("bundle", ".ezip", bundleDir); //$NON-NLS-1$ //$NON-NLS-2$
+ bundleFiles.add(output);
+ try {
+ encryptor.encrypt(input, output, publicKey.openStream());
+ } catch(GeneralSecurityException ex) {
+ throw (IOException) new IOException(ex.getMessage()).initCause(ex);
+ }
+ input.delete();
+ progress.worked(1);
+ }
+
+ return bundleFiles;
+ }
+
+ // NOTE: This exists solely to allow unit testing
+ public List<File> decryptBundles(List<File> inputFiles, File bundleDir, URL privateKey) throws IOException {
+ if(privateKey == null) {
+ return inputFiles;
+ }
+
+ List<File> bundleFiles = new ArrayList<File>();
+
+ PlexusEncryptor encryptor = new RsaAesPlexusEncryptor();
+
+ for(File input : inputFiles) {
+ File output = File.createTempFile("bundle", ".zip", bundleDir); //$NON-NLS-1$ //$NON-NLS-2$
+ bundleFiles.add(output);
+ InputStream is = null;
+ OutputStream os = null;
+ try {
+ is = new FileInputStream(input);
+ os = new FileOutputStream(output);
+ encryptor.decrypt(is, os, privateKey.openStream());
+ } catch(GeneralSecurityException ex) {
+ throw (IOException) new IOException(ex.getMessage()).initCause(ex);
+ } finally {
+ if(is != null) {
+ is.close();
+ }
+ if(os != null) {
+ os.close();
+ }
+ }
+ input.delete();
+ }
+
+ return bundleFiles;
+ }
+
+}
View
62 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/data/DataGathererFactory.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.maven.ide.eclipse.pr.IDataGatherer;
+
+
+/**
+ * Provides access to installed data gatherers.
+ */
+public class DataGathererFactory {
+
+ private static final String EXTENSION_POINT_ID = "org.maven.ide.eclipse.pr.dataGatherers"; //$NON-NLS-1$
+
+ private static final String ELEMENT_DATA_GATHERER = "gatherer"; //$NON-NLS-1$
+
+ private static final String ATTRIBUTE_CLASS = "class"; //$NON-NLS-1$
+
+ public static List<IDataGatherer> getDataGatherers() {
+ List<IDataGatherer> dataGatherers = new ArrayList<IDataGatherer>();
+
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint dataGatherersExtensionPoint = registry.getExtensionPoint(EXTENSION_POINT_ID);
+ if(dataGatherersExtensionPoint != null) {
+ IExtension[] dataGatherersExtensions = dataGatherersExtensionPoint.getExtensions();
+ for(IExtension extension : dataGatherersExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(ELEMENT_DATA_GATHERER.equals(element.getName())) {
+ try {
+ dataGatherers.add((IDataGatherer) element.createExecutableExtension(ATTRIBUTE_CLASS));
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+
+ return dataGatherers;
+ }
+
+}
View
42 ...maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/data/DataGatheringContext.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.data;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.maven.ide.eclipse.pr.IDataGatheringContext;
+import org.maven.ide.eclipse.pr.IDataTarget;
+
+
+/**
+ * Provides contextual information to data gatherers.
+ */
+class DataGatheringContext implements IDataGatheringContext {
+
+ private IDataTarget target;
+
+ private IProgressMonitor monitor;
+
+ public DataGatheringContext(IDataTarget target, IProgressMonitor monitor) {
+ this.target = target;
+ this.monitor = (monitor != null) ? monitor : new NullProgressMonitor();
+ }
+
+ public IProgressMonitor getMonitor() {
+ return monitor;
+ }
+
+ public IDataTarget getTarget() {
+ return target;
+ }
+
+}
View
43 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/messages.properties
@@ -0,0 +1,43 @@
+ConfigurationDetailsSource_date=*** Date: {0}
+ConfigurationDetailsSource_error=Can't write Eclipse configuration data
+Data_console=Maven console
+Data_eclipse_config=Eclipse configuration
+Data_global_settings=Maven global settings.xml
+Data_project_files=Maven project files
+Data_project_sources=Maven project sources
+Data_user_settings=Maven user settings.xml
+DataGatherer_error=Failure while gathering problem report data: {0}
+DataGatherer_monitor_encrypting=Encrypting problem data
+DataGatherer_monitor_gather=Gathering problem data
+EffectivePomSource_error1=Can't get project facade for {0}
+EffectivePomSource_error2=Can't get project facade for {0}
+EffectivePomSource_error3=Can't write effective pom source for {0}
+ProblemDescriptionPage_btnScreenshot=&Capture Screenshot from Clipboard
+ProblemDescriptionPage_description=Enter problem summary and description
+ProblemDescriptionPage_error_empty_desc=Problem description should not be blank
+ProblemDescriptionPage_error_empty_summary=Problem summary should not be blank
+ProblemDescriptionPage_error_empty_summary_desc=Problem summary and description should not be blank
+ProblemDescriptionPage_lblDesc=Problem &description:
+ProblemDescriptionPage_lblLink=<A>Set Jira user (optional)</A>
+ProblemDescriptionPage_lblProjects=Projects to &submit (with sources):
+ProblemDescriptionPage_lblSummary=Problem &summary:
+ProblemDescriptionPage_title=Problem details
+ProblemReportingMenuCreator_action_report=Report Issue...
+ProblemReportingSelectionPage_btnBrowse=&Browse...
+ProblemReportingSelectionPage_btnConsole=Maven console
+ProblemReportingSelectionPage_btnEclipseConfig=Eclipse configuration details
+ProblemReportingSelectionPage_btnErrorLog=Eclipse error .log
+ProblemReportingSelectionPage_btnExportAll=Export &all data
+ProblemReportingSelectionPage_btnGlobalSettings=Maven global settings.xml
+ProblemReportingSelectionPage_btnPomFiles=Maven pom files
+ProblemReportingSelectionPage_btnSources=Complete project &sources
+ProblemReportingSelectionPage_btnUserSettings=Maven user's settings.xml
+ProblemReportingSelectionPage_desc=Select data to include into reporting bundle
+ProblemReportingSelectionPage_fileDialog_text=Select file name to save problem reporting bundle
+ProblemReportingSelectionPage_lblLocation=&Location:
+ProblemReportingSelectionPage_title=Select data to include
+ProblemReportingWizard_job_gathering=Gathering Information
+ProblemReportingWizard_link_success=Successfully submitted issue to:
+ProblemReportingWizard_monitor_reading=Reading project information
+ProblemReportingWizard_title=Problem Reporting
+ProblemReportingWizard_window_title=Reporting Problem
View
127 ....eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/ConfigurationDetailsSource.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.sources;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.Date;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.about.ISystemSummarySection;
+import org.maven.ide.eclipse.pr.IDataSource;
+import org.maven.ide.eclipse.pr.internal.Messages;
+import org.maven.ide.eclipse.pr.internal.ProblemReportingPlugin;
+
+import com.ibm.icu.text.Collator;
+import com.ibm.icu.text.DateFormat;
+import com.ibm.icu.util.ULocale;
+
+
+/**
+ * Returns Eclipse configuration details.
+ */
+public class ConfigurationDetailsSource implements IDataSource {
+
+ public String getName() {
+ return "configurationDetails.txt"; //$NON-NLS-1$
+ }
+
+ public InputStream getInputStream() throws CoreException {
+ StringWriter out = new StringWriter();
+ PrintWriter writer = new PrintWriter(out);
+ writer.println(NLS.bind(Messages.ConfigurationDetailsSource_date, //
+ DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date())));
+ writer.println();
+
+ appendExtensions(writer);
+
+ writer.close();
+
+ try {
+ return new ByteArrayInputStream(out.toString().getBytes("UTF-8")); //$NON-NLS-1$
+ } catch(UnsupportedEncodingException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, ProblemReportingPlugin.PLUGIN_ID, -1, //
+ Messages.ConfigurationDetailsSource_error, ex));
+ }
+ }
+
+ private static void appendExtensions(PrintWriter writer) {
+ IConfigurationElement[] configElements = getSortedExtensions();
+ for(int i = 0; i < configElements.length; ++i) {
+ IConfigurationElement element = configElements[i];
+
+ writer.println(NLS.bind("*** {0}:", element.getAttribute("sectionTitle"))); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Object obj = null;
+ try {
+ obj = element.createExecutableExtension("class"); //$NON-NLS-1$
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ } catch (Exception ex) {
+ MavenLogger.log("Cannot create extension", ex); //$NON-NLS-1$
+ }
+
+ if(obj instanceof ISystemSummarySection) {
+ ISystemSummarySection logSection = (ISystemSummarySection) obj;
+ logSection.write(writer);
+ } else {
+ writer.println("Could not write section, see error log");
+ }
+
+ writer.println();
+ }
+ }
+
+ private static IConfigurationElement[] getSortedExtensions() {
+ IConfigurationElement[] configElements = Platform.getExtensionRegistry() //
+ .getConfigurationElementsFor("org.eclipse.ui.systemSummarySections"); //$NON-NLS-1$
+
+ Arrays.sort(configElements, new Comparator<IConfigurationElement>() {
+ Collator collator = Collator.getInstance(ULocale.getDefault());
+
+ public int compare(IConfigurationElement e1, IConfigurationElement e2) {
+ String id1 = e1.getAttribute("id"); //$NON-NLS-1$
+ String id2 = e2.getAttribute("id"); //$NON-NLS-1$
+
+ if(id1 != null && id2 != null && !id1.equals(id2)) {
+ return collator.compare(id1, id2);
+ }
+
+ String title1 = e1.getAttribute("sectionTitle"); //$NON-NLS-1$
+ String title2 = e2.getAttribute("sectionTitle"); //$NON-NLS-1$
+
+ if(title1 == null) {
+ title1 = ""; //$NON-NLS-1$
+ }
+ if(title2 == null) {
+ title2 = ""; //$NON-NLS-1$
+ }
+
+ return collator.compare(title1, title2);
+ }
+ });
+
+ return configElements;
+ }
+
+}
View
78 ...aven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/EffectivePomSource.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.sources;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+
+import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.osgi.util.NLS;
+import org.maven.ide.eclipse.pr.IDataSource;
+import org.maven.ide.eclipse.pr.internal.Messages;
+import org.maven.ide.eclipse.pr.internal.ProblemReportingPlugin;
+
+
+/**
+ * Returns the effective POM for a project.
+ */
+public class EffectivePomSource implements IDataSource {
+
+ private final MavenProjectManager mavenProjectManager;
+
+ private final IFile file;
+
+ private final IProgressMonitor monitor;
+
+ public EffectivePomSource(MavenProjectManager mavenProjectManager, IFile file, IProgressMonitor monitor) {
+ this.mavenProjectManager = mavenProjectManager;
+ this.file = file;
+ this.monitor = monitor;
+ }
+
+ public InputStream getInputStream() throws CoreException {
+ IMavenProjectFacade projectFacade;
+ try {
+ projectFacade = mavenProjectManager.create(file, true, monitor);
+ } catch(Exception ex) {
+ throw new CoreException(new Status(IStatus.ERROR, ProblemReportingPlugin.PLUGIN_ID, -1, //
+ NLS.bind(Messages.EffectivePomSource_error1, file.getLocation()), ex));
+ }
+ if(projectFacade == null) {
+ throw new CoreException(new Status(IStatus.ERROR, ProblemReportingPlugin.PLUGIN_ID, -1, //
+ NLS.bind(Messages.EffectivePomSource_error2, file.getLocation()), null));
+ }
+
+ StringWriter sw = new StringWriter();
+ try {
+ new MavenXpp3Writer().write(sw, projectFacade.getMavenProject(monitor).getModel());
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, ProblemReportingPlugin.PLUGIN_ID, -1, //
+ NLS.bind(Messages.EffectivePomSource_error3, file.getLocation()), ex));
+ }
+
+ return new ByteArrayInputStream(sw.getBuffer().toString().getBytes());
+ }
+
+ public String getName() {
+ return "pom-effective.pom"; //$NON-NLS-1$
+ }
+
+}
View
109 ...de.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/ObfuscatedSettingsSource.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.sources;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.List;
+
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.Settings;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.maven.ide.eclipse.pr.IDataSource;
+
+
+/**
+ * Includes global/user settings in the problem report after obfuscating any sensitive data like credentials.
+ */
+public class ObfuscatedSettingsSource implements IDataSource {
+
+ private final String filePath;
+
+ private final String name;
+
+ public ObfuscatedSettingsSource(String filePath, String name) {
+ this.filePath = filePath;
+ this.name = name;
+ }
+
+ public InputStream getInputStream() throws CoreException {
+ if(filePath != null) {
+ File file = new File(filePath);
+ if(file.isFile()) {
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+ Settings settings = maven.buildSettings(null, filePath);
+
+ List<Server> servers = settings.getServers();
+ if(servers != null) {
+ for(Server server : servers) {
+ server.setUsername(obfuscate(server.getUsername()));
+ server.setPassword(obfuscate(server.getPassword()));
+ server.setPassphrase(obfuscate(server.getPassphrase()));
+ }
+ }
+
+ List<Proxy> proxies = settings.getProxies();
+ if(proxies != null) {
+ for(Proxy proxy : proxies) {
+ proxy.setUsername(obfuscate(proxy.getUsername()));
+ proxy.setPassword(obfuscate(proxy.getPassword()));
+ }
+ }
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024 * 4);
+ maven.writeSettings(settings, baos);
+ return new ByteArrayInputStream(baos.toByteArray());
+ }
+ }
+ return null;
+ }
+
+ private String obfuscate(String data) {
+ if(data == null || data.length() <= 0) {
+ return null;
+ }
+
+ MessageDigest digest;
+ try {
+ digest = MessageDigest.getInstance("MD5"); //$NON-NLS-1$
+ } catch(NoSuchAlgorithmException ex) {
+ try {
+ digest = MessageDigest.getInstance("SHA"); //$NON-NLS-1$
+ } catch(NoSuchAlgorithmException ex1) {
+ return "***"; //$NON-NLS-1$
+ }
+ }
+ digest.update(data.getBytes());
+ byte messageDigest[] = digest.digest();
+ StringBuilder hexString = new StringBuilder(64);
+ for(int i = 0; i < messageDigest.length; i++ ) {
+ String hex = Integer.toHexString(0xFF & messageDigest[i]);
+ if(hex.length() == 1) {
+ hexString.append('0');
+ }
+ hexString.append(hex);
+ }
+ return hexString.toString();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+}
View
73 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/StatusSource.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.sources;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+
+import org.eclipse.core.runtime.IStatus;
+import org.maven.ide.eclipse.pr.IDataSource;
+
+
+/**
+ * Handles an {@link IStatus}.
+ */
+public class StatusSource implements IDataSource {
+
+ private final String name;
+
+ private final IStatus status;
+
+ public StatusSource(IStatus status, String name) {
+ this.status = status;
+ this.name = name;
+ }
+
+ public InputStream getInputStream() {
+ StringWriter sw = new StringWriter(256);
+
+ format(status, new PrintWriter(sw), ""); //$NON-NLS-1$
+
+ try {
+ return new ByteArrayInputStream(sw.toString().getBytes("UTF-8")); //$NON-NLS-1$
+ } catch(UnsupportedEncodingException ex) {
+ return new ByteArrayInputStream(new byte[0]);
+ }
+ }
+
+ private void format(IStatus status, PrintWriter writer, String indent) {
+ writer.println(indent + "Severity = " + status.getSeverity()); //$NON-NLS-1$
+ writer.println(indent + "Plugin = " + status.getPlugin()); //$NON-NLS-1$
+ writer.println(indent + "Code = " + status.getCode()); //$NON-NLS-1$
+ writer.println(indent + "Message = " + status.getMessage()); //$NON-NLS-1$
+
+ Throwable exception = status.getException();
+ if(exception != null) {
+ exception.printStackTrace(writer);
+ }
+
+ IStatus[] children = status.getChildren();
+ if(children != null) {
+ for(IStatus child : children) {
+ format(child, writer, indent + " "); //$NON-NLS-1$
+ }
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+}
View
49 ...maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/TextConsoleSource.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.sources;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.ui.console.TextConsole;
+import org.maven.ide.eclipse.pr.IDataSource;
+
+/**
+ * Returns the contents of a TextConsole window.
+ */
+public class TextConsoleSource implements IDataSource {
+
+ private final MavenConsole console;
+ private final String name;
+
+ public TextConsoleSource(MavenConsole console, String name) {
+ this.console = console;
+ this.name = name;
+ }
+
+ public InputStream getInputStream() throws CoreException {
+ if(console instanceof TextConsole) {
+ IDocument document = ((TextConsole) console).getDocument();
+ String consoleText = document.get();
+ return new ByteArrayInputStream(consoleText.getBytes());
+ }
+ return null;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+}
View
44 ...ven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/sources/WorkspaceFileSource.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.sources;
+
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.maven.ide.eclipse.pr.IDataSource;
+
+
+/**
+ * Returns the contents of a file in the workspace.
+ */
+public class WorkspaceFileSource implements IDataSource {
+
+ private final IFile file;
+
+ public WorkspaceFileSource(IFile file) {
+ this.file = file;
+ }
+
+ public InputStream getInputStream() throws CoreException {
+ if(file != null && file.isAccessible()) {
+ return file.getContents();
+ } else {
+ return null;
+ }
+ }
+
+ public String getName() {
+ return file.getName();
+ }
+
+}
View
50 org.maven.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/wizard/HyperlinkDialog.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2010 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.maven.ide.eclipse.pr.internal.wizard;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.program.Program;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author Anton Kraev
+ */
+public class HyperlinkDialog extends MessageDialog {
+
+ private String url;
+
+ public HyperlinkDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
+ int dialogImageType, String[] dialogButtonLabels, int defaultIndex, String url) {
+ super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
+ this.url = url;
+ }
+
+ protected Control createCustomArea(Composite parent) {
+ Link link = new Link(parent, SWT.None);
+ link.setText("<a href=\"#\">" + url + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$
+ link.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Program.launch(url);
+ }
+ });
+ link.setToolTipText(url);
+ return link;
+ }
+
+}
View
221 ...n.ide.eclipse.pr/src/org/maven/ide/eclipse/pr/internal/wizard/ProblemDescriptionPage.java
@@ -0,0 +1,221 @@
+/*******************************************************************************
+