Skip to content

Commit

Permalink
Support for eclipse 2022-09 (#61)
Browse files Browse the repository at this point in the history
* Support for eclipse 2022-09

* Upgrade java version in verifier

Co-authored-by: Marcel Ring (windm) <[email protected]>
  • Loading branch information
Wallabeng and Marcel Ring (windm) authored Oct 18, 2022
1 parent c787e16 commit 1c5c9b0
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.project
bin/
target/
.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ 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.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
Original file line number Diff line number Diff line change
Expand Up @@ -147,31 +147,31 @@ public static String toPath(ArtifactKey artifactKey)
{
StringBuilder builder = new StringBuilder();

if (artifactKey.getGroupId() != null)
if (artifactKey.groupId() != null)
{
builder.append(artifactKey.getGroupId().replace('.', '/'));
builder.append(artifactKey.groupId().replace('.', '/'));
}

if (artifactKey.getVersion() != null)
if (artifactKey.version() != null)
{
if (builder.length() > 0)
{
builder.append("/");
}

builder.append(artifactKey.getVersion());
builder.append(artifactKey.version());
}

if (builder.length() > 0)
{
builder.append("/");
}

builder.append(artifactKey.getArtifactId());
builder.append(artifactKey.artifactId());

if (artifactKey.getVersion() != null)
if (artifactKey.version() != null)
{
builder.append("-").append(artifactKey.getVersion());
builder.append("-").append(artifactKey.version());
}

// TODO where's the classifier!?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class MavenDependencyInfo
*/
public static MavenDependencyInfo create(ArtifactRef artifactRef)
{
return new MavenDependencyInfo(artifactRef.getGroupId(), artifactRef.getArtifactId(), artifactRef.getVersion(),
artifactRef.getClassifier(), null, false, MavenScope.to(artifactRef.getScope()));
return new MavenDependencyInfo(artifactRef.artifactKey().groupId(), artifactRef.artifactKey().artifactId(), artifactRef.artifactKey().version(),
artifactRef.artifactKey().classifier(), null, false, MavenScope.to(artifactRef.scope()));
}

/**
Expand All @@ -49,8 +49,8 @@ public static MavenDependencyInfo create(ArtifactRef artifactRef)
*/
public static MavenDependencyInfo create(IMavenProjectFacade facade, String variant, MavenScope scope)
{
return new MavenDependencyInfo(facade.getArtifactKey().getGroupId(), facade.getArtifactKey().getArtifactId(),
facade.getArtifactKey().getVersion(), facade.getArtifactKey().getClassifier(), variant, true, scope);
return new MavenDependencyInfo(facade.getArtifactKey().groupId(), facade.getArtifactKey().artifactId(),
facade.getArtifactKey().version(), facade.getArtifactKey().classifier(), variant, true, scope);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
// limitations under the License.
package net.sourceforge.eclipsejetty.util;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

Expand Down Expand Up @@ -97,15 +99,16 @@ public MavenDependencyInfoMap(JettyLaunchConfigurationAdapter adapter,

private void buildLocations(IMavenProjectFacade facade)
{
addLocations(facade, "output", MavenScope.COMPILE, facade.getOutputLocation()); //$NON-NLS-1$
addLocations(facade, "output", MavenScope.COMPILE, Collections.singletonList(facade.getOutputLocation())); //$NON-NLS-1$
addLocations(facade, "resource", MavenScope.RUNTIME, facade.getResourceLocations()); //$NON-NLS-1$
addLocations(facade, "test-output", MavenScope.TEST, facade.getTestOutputLocation()); //$NON-NLS-1$
addLocations(facade, "test-output", MavenScope.TEST, Collections.singletonList(facade.getTestOutputLocation())); //$NON-NLS-1$
addLocations(facade, "test-resource", MavenScope.TEST, facade.getTestResourceLocations()); //$NON-NLS-1$
}

private void addLocations(IMavenProjectFacade facade, String variant, MavenScope scope, IPath... paths)
private void addLocations(IMavenProjectFacade facade, String variant, MavenScope scope, List<IPath> paths)
{
if ((paths == null) || (paths.length == 0))
if (paths == null || paths.size() == 0
|| (paths.size() == 1 && paths.get(0) == null))
{
return;
}
Expand All @@ -125,7 +128,7 @@ private void addLocations(IMavenProjectFacade facade, String variant, MavenScope

private void buildArtifact(ArtifactRef artifactRef)
{
String portableString = artifactRef.getArtifactKey().toPortableString();
String portableString = artifactRef.artifactKey().toPortableString();

dependencies.put(portableString, MavenDependencyInfo.create(artifactRef));
}
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<version>3.8.0</version>
</requireMavenVersion>
<requireJavaVersion>
<version>11</version>
<version>17</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down Expand Up @@ -205,8 +205,8 @@

<repositories>
<repository>
<id>eclipse-2021-12</id>
<url>http://download.eclipse.org/releases/2021-12</url>
<id>eclipse-2022-09</id>
<url>http://download.eclipse.org/releases/2022-09</url>
<layout>p2</layout>
</repository>
</repositories>
Expand Down

0 comments on commit 1c5c9b0

Please sign in to comment.