repo-reorg-2020: moved sts4-relevant spring-ide bundles from https://github.com/spring-projects/spring-ide/releases/tag/REPO-REORG-2020 into sts4 repo

This commit is contained in:
Martin Lippert
2020-09-29 14:00:01 +02:00
parent 8edfab1a16
commit de16884b60
2210 changed files with 160282 additions and 43 deletions

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="gradle-plugin/sts-gradle-model-plugin.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -0,0 +1 @@
/gradle-plugin/*.jar

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.springframework.ide.eclipse.buildship30</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

View File

@@ -0,0 +1,25 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.springframework.ide.eclipse.buildship30;singleton:=true
Bundle-Version: 4.8.1.qualifier
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Eclipse-LazyStart: true
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.springsource.ide.eclipse.commons.core,
org.eclipse.core.resources,
org.springsource.ide.eclipse.commons.frameworks.core,
org.springframework.ide.eclipse.boot.wizard,
org.eclipse.jface,
org.apache.commons.io,
org.eclipse.buildship.core;bundle-version="[3.0.0,4.0.0)";resolution:=optional,
org.eclipse.ui.workbench,
com.google.guava,
org.springsource.ide.eclipse.commons.livexp,
org.springframework.ide.eclipse.boot;bundle-version="3.9.12"
Bundle-ClassPath: gradle-plugin/sts-gradle-model-plugin.jar,
.
Bundle-Activator: org.springframework.ide.eclipse.buildship30.Buildship30Plugin

View File

@@ -0,0 +1,5 @@
# Specify gradle bundles as optional non greedy
requires.0.namespace=osgi.bundle
requires.0.name=org.eclipse.buildship.core
requires.0.greedy=false
requires.0.optional=true

View File

@@ -0,0 +1,248 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>About Spring IDE</title>
<meta name="author" content="Spring IDE Developers">
</head>
<body>
<h2>About Spring IDE</h2>
<p>March 26, 2007</p>
<h3>Abstract</h3>
<p>Spring IDE is a set of plugins which provide a user interface for
<a href="https://www.springframework.org">The Spring Framework</a>'s bean
factory XML configuration files including support for Spring 2.0
namespaces, AOP configuration and Spring Web Flow.</p>
<h3>License</h3>
<p>The Spring IDE Project makes available all content in this
plug-in (&quot;Content&quot;). Unless otherwise indicated below, the
Content is provided to you under the terms and conditions of the Eclipse
Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is
available at <a href="https://www.eclipse.org/legal/epl-v10.html">https://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from the Spring IDE
Project, the Content is being redistributed by another party
(&quot;Redistributor&quot;) and different terms and conditions may apply
to your use of any object code in the Content. Check the Redistributor's
license that was provided with the Content. If no such license exists,
contact the Redistributor. Unless otherwise indicated below, the terms
and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="https://www.eclipse.org">https://www.eclipse.org</a>.</p>
<h3>Third Party Content</h3>
<p>The Content includes items that have been sourced from third
parties as set out below. If you did not receive this Content directly
from the Spring IDE Project, the following is provided for informational
purposes only, and you should look to the Redistributor's license for
terms and conditions of use.</p>
<p><em> <strong>The Spring Framework v3.0.5</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Spring Web Flow v2.0.7.A</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Spring Web Services v1.5.8</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Spring Security v3.0.2</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Spring Dynamic Modules for OSGi(TM) Runtimes v2.0.0.M2</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Spring Batch v2.1.0</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Commons Codec v1.3.0</strong>
<p>This product includes software developed by The Apache Software
Foundation (<a href="https://www.apache.org/">https://www.apache.org/</a>).</p>
<p><em> <strong>Commons Collections v3.2.0</strong>
<p>This product includes software developed by The Apache Software
Foundation (<a href="https://www.apache.org/">https://www.apache.org/</a>).</p>
<p><em> <strong>Commons Logging v1.1.1</strong>
<p>This product includes software developed by The Apache Software
Foundation (<a href="https://www.apache.org/">https://www.apache.org/</a>).</p>
<p><em> <strong>Apache MyFaces v1.2.2</strong>
<p>This product includes software developed by The Apache Software
Foundation (<a href="https://www.apache.org/">https://www.apache.org/</a>).</p>
<p><em> <strong>AspectJ Weaver v1.6.10</strong>
<p>This product includes software developed by The Eclipse Software
Foundation (<a href="https://www.eclipse.org/">https://www.eclipse.org/</a>).</p>
<p><em> <strong>Antlr v3.0.1</strong>
<p>Spring IDE includes a binary version of Antlr v3.0.1 (<a
href="https://www.antlr.org">https://www.antlr.org/</a>).
The source code for Antlr is available from the Antlr download site at
<a href="https://www.antlr.org/download.html">https://www.antlr.org/download.html</a>.
<p>The Antlr license is available at <a
href="https://www.antlr.org/license.html">https://www.antlr.org/license.html</a>.
The license is also reproduced here:</p>
<pre>Copyright (c) 2003-2007, Terence Parr
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the author nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</pre></p>
<p><em> <strong>ASM v2.2.3</strong>
<p>Spring IDE includes a binary version of ASM v2.2.3 (<a
href="https://asm.objectweb.org/index.html">https://asm.objectweb.org/</a>).
The source code for ASM is available from the ObjectWeb download site at
<a href="https://asm.objectweb.org/download/">https://asm.objectweb.org/download/</a>.
<p>The ASM license is available at <a
href="https://asm.objectweb.org/license.html">https://asm.objectweb.org/license.html</a>.
The license is also reproduced here:</p>
<pre>Copyright (c) 2000-2005 INRIA, France Telecom
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
</pre></p>
<p><em> <strong>backport-util-concurrent 3.1.0</strong>
<p>Spring IDE includes a binary version of backport-util-concurrent v3.1.0 (<a
href="https://dcl.mathcs.emory.edu/util/backport-util-concurrent/">https://dcl.mathcs.emory.edu/util/backport-util-concurrent/</a>).
The source code for backport-util-concurrent is available from the download site at
<a href="https://dcl.mathcs.emory.edu/util/backport-util-concurrent/dist/">https://dcl.mathcs.emory.edu/util/backport-util-concurrent/dist/</a>.
<p>The backport-util-concurrent license is available at <a
href="https://creativecommons.org/licenses/publicdomain">https://creativecommons.org/licenses/publicdomain</a>.
The license is also reproduced here:</p>
<pre><em>Copyright-Only Dedication (based on United States law) or Public Domain Certification</em>
The person or persons who have associated work with this document (the
"Dedicator" or "Certifier") hereby either (a) certifies that, to the
best of his knowledge, the work of authorship identified is in the public
domain of the country from which the work is published, or (b) hereby
dedicates whatever copyright the dedicators holds in the work of authorship
identified below (the "Work") to the public domain. A certifier, moreover,
dedicates any copyright interest he may have in the associated work, and
for these purposes, is described as a "dedicator" below.
A certifier has taken reasonable steps to verify the copyright status of
this work. Certifier recognizes that his good faith efforts may not shield
him from liability if in fact the work certified is not in the public domain.
Dedicator makes this dedication for the benefit of the public at large and
to the detriment of the Dedicator's heirs and successors. Dedicator intends
this dedication to be an overt act of relinquishment in perpetuity of all
present and future rights under copyright law, whether vested or contingent,
in the Work. Dedicator understands that such relinquishment of all rights
includes the relinquishment of all rights to enforce (by lawsuit or otherwise)
those copyrights in the Work.
Dedicator recognizes that, once placed in the public domain, the Work may be
freely reproduced, distributed, transmitted, used, modified, built upon, or
otherwise exploited by anyone for any purpose, commercial or non-commercial,
and in any way, including by methods that have not yet been invented or
conceived.
</pre></p>
<p><em> <strong>AOP Alliance</strong>
<p>LICENCE: all the source code provided by AOP Alliance is Public Domain.
</p>
<p><em> <strong>javax.el v1.0.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.jms v1.1.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.servlet v2.5.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.servlet.jsp v2.1.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.servlet.jsp.jstl v1.2.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.activation v1.1.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.annotation v1.0.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.mail v1.4.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.xml.stream v1.0.1</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.xml.ws v2.1.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
</em></p>
<address>Copyright (c) 2005, 2011 Spring IDE Developers</address>
</body>
</html>

View File

@@ -0,0 +1,10 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.properties,\
plugin.xml,\
about.html,\
gradle-plugin/sts-gradle-model-plugin.jar,\
gradle-plugin/init.gradle

View File

@@ -0,0 +1,9 @@
initscript {
dependencies {
classpath files('sts-gradle-model-plugin.jar')
}
}
allprojects {
apply plugin: sts.model.plugin.StsModelPlugin
}

View File

@@ -0,0 +1,2 @@
pluginName=Spring IDE Buildship Integration
providerName=Spring IDE Developers

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.3"?>
<!--
/*******************************************************************************
* Copyright (c) 2012 Spring IDE Developers
* 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
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Spring IDE Developers - initial API and implementation
*******************************************************************************/
-->
<plugin>
<extension
point="org.springframework.ide.eclipse.wizard.import.strategy">
<import-strategy
buildType="GRADLE"
class="org.springframework.ide.eclipse.buildship30.Buildship30ImportStrategy$Factory"
notInstalledMessage="Buildship Gradle Tooling version 3.x is not installed. You can install it from Eclipse Marketplace."
name="Buildship 3.x">
</import-strategy>
</extension>
<extension
point="org.springframework.ide.eclipse.boot.project">
<project
nature="org.eclipse.buildship.core.gradleprojectnature"
projectClass="org.springframework.ide.eclipse.buildship30.GradleSpringBootProject">
</project>
</extension>
</plugin>

View File

@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot.ide</groupId>
<artifactId>org.springframework.boot.ide</artifactId>
<version>4.8.1-SNAPSHOT</version>
<relativePath>../../eclipse-distribution/pom.xml</relativePath>
</parent>
<groupId>org.springframework.ide.eclipse</groupId>
<artifactId>org.springframework.ide.eclipse.buildship30</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<gradle.executable>./gradlew</gradle.executable>
<gradle.model-plugin.artifactId>sts-gradle-model-plugin</gradle.model-plugin.artifactId>
</properties>
<profiles>
<profile>
<id>e45</id>
<repositories>
<repository>
<id>buildship3</id>
<layout>p2</layout>
<url>https://download.eclipse.org/buildship/updates/e45/snapshots/3.x</url>
</repository>
</repositories>
</profile>
<profile>
<id>e46</id>
<repositories>
<repository>
<id>buildship3</id>
<layout>p2</layout>
<url>https://download.eclipse.org/buildship/updates/e46/snapshots/3.x</url>
</repository>
</repositories>
</profile>
<profile>
<id>e47</id>
<repositories>
<repository>
<id>buildship3</id>
<layout>p2</layout>
<url>https://download.eclipse.org/buildship/updates/e47/snapshots/3.x</url>
</repository>
</repositories>
</profile>
<profile>
<id>e48</id>
<repositories>
<repository>
<id>buildship3</id>
<layout>p2</layout>
<url>https://download.eclipse.org/buildship/updates/e48/snapshots/3.x</url>
</repository>
</repositories>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}/gradle-plugin</directory>
<includes>
<include>*.jar</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>sts-gradle-model-build</id>
<phase>generate-resources</phase>
<configuration>
<workingDirectory>${project.basedir}/../sts-gradle-model-plugin/sts-gradle-model-plugin</workingDirectory>
<executable>${gradle.executable}</executable>
<arguments>
<argument>clean</argument>
<argument>build</argument>
<argument>-S</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-sts-gradle-model-jars</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/gradle-plugin</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/../sts-gradle-model-plugin/sts-gradle-model-plugin/build/libs/</directory>
<includes>
<include>${gradle.model-plugin.artifactId}.jar</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>ignore</pomDependencies>
<dependency-resolution>
<optionalDependencies>require</optionalDependencies>
<extraRequirements>
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.buildship.core</id>
<versionRange>[3.0.0,4.0.0)</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
<!-- <filters> -->
<!-- <filter> -->
<!-- <type>p2-installable-unit</type> -->
<!-- <id>org.eclipse.buildship.core</id> -->
<!-- <versionRange>[2.0.0,3.0.0)</versionRange> -->
<!-- </filter> -->
<!-- </filters> -->
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>plugin-source</id>
<phase>generate-sources</phase>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>second-generate-p2-metadata</id>
<goals>
<goal>p2-metadata</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,121 @@
/*******************************************************************************
* Copyright (c) 2015, 2020 Pivotal, 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
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.buildship30;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.lang.reflect.InvocationTargetException;
import java.nio.charset.Charset;
import org.apache.commons.io.IOUtils;
import org.eclipse.buildship.core.BuildConfiguration;
import org.eclipse.buildship.core.GradleBuild;
import org.eclipse.buildship.core.GradleCore;
import org.eclipse.buildship.core.SynchronizationResult;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.springframework.ide.eclipse.boot.wizard.content.BuildType;
import org.springframework.ide.eclipse.boot.wizard.importing.ImportConfiguration;
import org.springframework.ide.eclipse.boot.wizard.importing.ImportStrategy;
import org.springframework.ide.eclipse.boot.wizard.importing.ImportStrategyFactory;
import org.springsource.ide.eclipse.commons.core.SpringCoreUtils;
import org.springsource.ide.eclipse.commons.core.util.NatureUtils;
import org.springsource.ide.eclipse.commons.livexp.util.ExceptionUtil;
/**
* Importer strategy implementation for importing CodeSets into the workspace and set them
* up to use Buildship Gradle Tooling.
*
* @author Kris De Volder
*/
public class Buildship30ImportStrategy extends ImportStrategy {
public Buildship30ImportStrategy(BuildType buildType, String name, String notInstalledMessage) {
super(buildType, name, notInstalledMessage);
}
public static class Factory implements ImportStrategyFactory {
@Override
public ImportStrategy create(BuildType buildType, String name, String notInstalledMessage) throws Exception {
Assert.isLegal(buildType==BuildType.GRADLE);
Class.forName("org.eclipse.buildship.core.GradleBuild");
return new Buildship30ImportStrategy(buildType, name, notInstalledMessage);
}
}
@Override
public IRunnableWithProgress createOperation(final ImportConfiguration conf) {
return new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor mon) throws InvocationTargetException, InterruptedException {
mon.beginTask("Import Gradle Buildship project", 10);
try {
File loc = new File(conf.getLocation());
conf.getCodeSet().createAt(loc);
// Replace project name in the settings.gradle file with the one from `conf.getProjectName()`
// i.e. replace rootProject.name = 'project' with rootProject.name = 'project-generated'
File settingsFile = new File(loc, "settings.gradle");
if (settingsFile.exists()) {
String content = IOUtils.toString(new FileInputStream(settingsFile), Charset.defaultCharset());
String newContent = content.replaceAll("(\\s*rootProject\\.name\\s*=\\s*').*('\\s*)", "$1" + conf.getProjectName() + "$2");
IOUtils.write(newContent.getBytes(), new FileOutputStream(settingsFile));
}
GradleBuild build = GradleCore.getWorkspace().createBuild(BuildConfiguration.forRootProjectDirectory(loc).build());
SynchronizationResult buildResult = build.synchronize(SubMonitor.convert(mon, 9));
if (buildResult.getStatus().isOK()) {
//For STS3 we should add spring nature? But what project? The buildresult doesn't tell us what was imported.
//We try to work around this by looking for the project in the workspace by its location.
IContainer[] containers = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI(loc.toURI());
if (containers!=null) {
for (IContainer c : containers) {
if (c instanceof IProject) {
IProject p = (IProject) c;
try {
NatureUtils.ensure(p, new NullProgressMonitor(), SpringCoreUtils.NATURE_ID);
} catch (CoreException e) {
//Ignore: happens in STS 4 which no longer has spring nature.
}
}
}
}
} else if (!mon.isCanceled()) {
//Try not to loose the error completely.
throw ExceptionUtil.coreException(buildResult.getStatus());
}
} catch (Exception e) {
if (e instanceof InterruptedException) {
throw (InterruptedException)e;
}
if (e instanceof InvocationTargetException) {
throw (InvocationTargetException)e;
}
throw new InvocationTargetException(e);
}
finally {
mon.done();
}
}
};
}
}

View File

@@ -0,0 +1,37 @@
/*******************************************************************************
* Copyright (c) 2020 Pivotal, 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
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.buildship30;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
public class Buildship30Plugin extends Plugin {
// The shared instance
private static Buildship30Plugin plugin;
public static Buildship30Plugin getDefault() {
return plugin;
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}
}

View File

@@ -0,0 +1,282 @@
/*******************************************************************************
* Copyright (c) 2020 Pivotal, 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
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.buildship30;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import org.eclipse.buildship.core.GradleBuild;
import org.eclipse.buildship.core.GradleCore;
import org.eclipse.buildship.core.internal.workspace.NewProjectHandler;
import org.eclipse.buildship.core.internal.workspace.SynchronizationJob;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.gradle.tooling.ModelBuilder;
import org.gradle.tooling.model.GradleModuleVersion;
import org.gradle.tooling.model.eclipse.EclipseExternalDependency;
import org.gradle.tooling.model.eclipse.EclipseProject;
import org.gradle.tooling.model.eclipse.EclipseProjectNature;
import org.springframework.ide.eclipse.boot.core.IMavenCoordinates;
import org.springframework.ide.eclipse.boot.core.MavenId;
import org.springframework.ide.eclipse.boot.core.initializr.InitializrService;
import org.springframework.ide.eclipse.boot.core.initializr.InitializrUrl;
import org.springframework.ide.eclipse.boot.core.internal.SpringBootProject;
import org.springframework.ide.eclipse.boot.util.DependencyDelta;
import org.springsource.ide.eclipse.commons.livexp.util.Log;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import sts.model.plugin.StsToolingModel;
@SuppressWarnings("restriction")
public class GradleSpringBootProject extends SpringBootProject {
private static final String SPRING_BOOT_GROUP = "org.springframework.boot";
private static final String SPRING_BOOT_NAME = "spring-boot";
private static final String WAR_PKG_NATURE = "org.eclipse.wst.common.project.facet.core.nature";
private static final Supplier<Path> cacheFolderSupplier = Suppliers.memoize(() -> {
IPath iPath = Buildship30Plugin.getDefault().getStateLocation().makeAbsolute();
return iPath.toFile().toPath().resolve("gradle-plugin");
});
private static class GradleModels {
EclipseProject eclipseProject;
StsToolingModel stsToolingModel;
public GradleModels(EclipseProject eclipseProject, StsToolingModel stsToolingModel) {
super();
this.eclipseProject = eclipseProject;
this.stsToolingModel = stsToolingModel;
}
public String groupId() {
return stsToolingModel.group();
}
public String bootVersion() {
for (EclipseExternalDependency dep : eclipseProject.getClasspath()) {
GradleModuleVersion moduleVersion = dep.getGradleModuleVersion();
if (SPRING_BOOT_GROUP.equals(moduleVersion.getGroup())
&& SPRING_BOOT_NAME.equals(moduleVersion.getName())) {
return moduleVersion.getVersion();
}
}
return null;
}
public String version() {
return stsToolingModel.version();
}
public String description() {
return eclipseProject.getDescription();
}
public String artifactId() {
return stsToolingModel.artifact();
}
public String packaging() {
for (EclipseProjectNature nature : eclipseProject.getProjectNatures()) {
if (WAR_PKG_NATURE.equals(nature.getId())) {
return "war";
}
}
return "jar";
}
public String javaVersion() {
return eclipseProject.getJavaSourceSettings().getSourceLanguageLevel().getMajorVersion();
}
}
private Supplier<GradleModels> gradleProject = Suppliers.memoize(() -> {
try {
return CompletableFuture.supplyAsync(() -> {
Optional<GradleBuild> build = GradleCore.getWorkspace().getBuild(project);
if (build.isPresent()) {
try {
return build.get().withConnection(connection -> {
ModelBuilder<StsToolingModel> stsModelBuilder = connection.model(StsToolingModel.class)
.withArguments("--init-script", getInitScript().toString());
return new GradleModels(connection.model(EclipseProject.class).get(),
stsModelBuilder.get());
}, new NullProgressMonitor());
} catch (Exception e) {
Log.log(e);
return null;
}
}
Log.error("Cannot connect to Gradle project");
return null;
}).get();
} catch (Exception e) {
return null;
}
});
public GradleSpringBootProject(IProject project, InitializrService initializr) {
super(project, initializr);
}
@Override
public List<IMavenCoordinates> getDependencies() throws Exception {
return null;
}
@Override
public void modifyDependencies(DependencyDelta values) throws Exception {
throw new UnsupportedOperationException("Not implemented!");
}
@Override
public void addMavenDependency(IMavenCoordinates dep, boolean preferManagedVersion) throws Exception {
throw new UnsupportedOperationException("Not implemented!");
}
@Override
public void addMavenDependency(IMavenCoordinates depConfigurationProcessor, boolean preferManagedVersion,
boolean optional) throws CoreException {
throw new UnsupportedOperationException("Not implemented!");
}
@Override
public String getBootVersion() {
GradleModels models = gradleProject.get();
if (models != null) {
return models.bootVersion();
}
return null;
}
@Override
public Job updateProjectConfiguration() {
return GradleCore.getWorkspace().getBuild(project).map(build -> {
SynchronizationJob job = new SynchronizationJob(NewProjectHandler.IMPORT_AND_MERGE,
Collections.singleton(build));
job.schedule();
return job;
}).orElse(null);
}
@Override
public void removeMavenDependency(MavenId mavenId) throws CoreException {
throw new UnsupportedOperationException("Not implemented!");
}
@Override
public String getDependencyFileName() {
throw new UnsupportedOperationException("Not implemented!");
}
@Override
public String getPackaging() throws CoreException {
GradleModels models = gradleProject.get();
if (models != null) {
return models.packaging();
}
return null;
}
@Override
public String buildType() {
return InitializrUrl.GRADLE_PROJECT;
}
@Override
public String artifactId() throws CoreException {
GradleModels models = gradleProject.get();
if (models != null) {
return models.artifactId();
}
return null;
}
@Override
public String groupId() throws CoreException {
GradleModels models = gradleProject.get();
if (models != null) {
return models.groupId();
}
return null;
}
@Override
public String javaVersion() throws CoreException {
GradleModels models = gradleProject.get();
if (models != null) {
return models.javaVersion();
}
return null;
}
@Override
public String version() throws CoreException {
GradleModels models = gradleProject.get();
if (models != null) {
return models.version();
}
return null;
}
@Override
public String description() throws CoreException {
GradleModels models = gradleProject.get();
if (models != null) {
return models.description();
}
return null;
}
@Override
public File executePackagingScript(IProgressMonitor monitor) throws CoreException {
throw new UnsupportedOperationException("Not implemented!");
}
private Path getInitScript() {
Path cacheFolder = cacheFolderSupplier.get();
Path initScript = cacheFolder.resolve("init.gradle");
Path jarPath = cacheFolder.resolve("sts-gradle-model-plugin.jar");
if (!Files.isDirectory(cacheFolder)) {
cacheFolder.toFile().mkdirs();
}
if (!Files.exists(initScript)) {
try {
Files.copy(getClass().getResourceAsStream("/gradle-plugin/init.gradle"), initScript);
} catch (IOException e) {
Log.log(e);
}
}
if (!Files.exists(jarPath)) {
try {
Files.copy(getClass().getResourceAsStream("/gradle-plugin/sts-gradle-model-plugin.jar"),
jarPath);
} catch (IOException e) {
Log.log(e);
}
}
return initScript;
}
}