Skip to content

Commit

Permalink
Improve source content relocation
Browse files Browse the repository at this point in the history
  • Loading branch information
pwoodworth committed May 22, 2024
1 parent fbbec08 commit d758931
Show file tree
Hide file tree
Showing 12 changed files with 430 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Contributing to [Apache Maven Shade Plugin](https://maven.apache.org/plugins/mav
[![ASF Jira](https://img.shields.io/endpoint?url=https%3A%2F%2Fmaven.apache.org%2Fbadges%2Fasf_jira-MSHADE.json)][jira]
[![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)][license]
[![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven.plugins/maven-shade-plugin.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.apache.maven.plugins/maven-shade-plugin)
[![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central#org.apache.maven.plugins:maven-shade-plugin)
[![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/apache/maven/plugins/maven-shade-plugin/README.md)
[![Jenkins Status](https://img.shields.io/jenkins/s/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-shade-plugin/job/master.svg?)][build]
[![Jenkins tests](https://img.shields.io/jenkins/t/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-shade-plugin/job/master.svg?)][test-results]

Expand Down
53 changes: 43 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</parent>

<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.1-air-9-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>Apache Maven Shade Plugin</name>
Expand All @@ -44,10 +44,10 @@
</prerequisites>

<scm>
<connection>scm:git:https://gitbox.apache.org/repos/asf/maven-shade-plugin.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-shade-plugin.git</developerConnection>
<url>https://github.com/apache/maven-shade-plugin/tree/${project.scm.tag}</url>
<tag>maven-shade-plugin-3.4.1</tag>
<connection>scm:git:[email protected]:urbanairship/maven-shade-plugin.git</connection>
<developerConnection>scm:git:[email protected]:urbanairship/maven-shade-plugin.git</developerConnection>
<url>https://github.com/urbanairship/maven-shade-plugin/tree/${project.scm.tag}</url>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>jira</system>
Expand All @@ -58,10 +58,14 @@
<url>https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-shade-plugin/</url>
</ciManagement>
<distributionManagement>
<site>
<id>apache.website</id>
<url>scm:svn:https://svn.apache.org/repos/asf/maven/website/components/${maven.site.path}</url>
</site>
<repository>
<id>releases</id>
<url>gs://airship-maven-artifacts/releases</url>
</repository>
<snapshotRepository>
<id>snapshot</id>
<url>gs://airship-maven-artifacts/snapshots</url>
</snapshotRepository>
</distributionManagement>

<properties>
Expand All @@ -71,7 +75,7 @@
<currentVersion>${project.version}</currentVersion>
<asmVersion>9.4</asmVersion>
<slf4j.version>1.7.32</slf4j.version>
<project.build.outputTimestamp>2022-10-21T20:02:32Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2022-10-21T20:02:58Z</project.build.outputTimestamp>
</properties>

<contributors>
Expand Down Expand Up @@ -261,8 +265,37 @@
</dependencies>

<build>
<extensions>
<extension>
<groupId>com.gkatzioura.maven.cloud</groupId>
<artifactId>google-storage-wagon</artifactId>
<version>1.7</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
Expand Down
32 changes: 32 additions & 0 deletions src/it/projects/reloc-source-content-with-fqn/impl/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<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.apache.maven.its.shade.rscwf</groupId>
<artifactId>test-parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>test-impl</artifactId>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import java.util.List;

public class Main
{
public static relocated.StringMessage getStringMessage( CharSequence s )
{
relocated.StringMessage msg;
if (s instanceof String)
{
msg = new relocated.StringMessage( (String) s );
}
else if (s == null) {
msg = relocated.StringMessage.EMPTY;
}
else
{
msg = relocated.StringMessage
.from( s );
}
return msg;
}

public static relocated.StringMessage[] toStringMessageArray( List<relocated.Message> messages )
{
return messages.stream()
.map( m ->
{
if (m instanceof relocated.StringMessage)
{
return (relocated.StringMessage) m;
}
else
{
return getStringMessage( m.asString() );
}
} ).toArray( relocated.StringMessage[]::new );
}


public static class MyMessage extends relocated.StringMessage implements relocated.Message
{
public MyMessage( String s ) throws relocated.MessageException
{
super(s);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package relocated;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

public interface Message
{
String asString();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package relocated;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

public class MessageException extends Exception
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package relocated;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import java.util.Objects;

public class StringMessage implements Message
{
public static final StringMessage EMPTY = new StringMessage("");

private final String value;

public StringMessage( String value )
{
this.value = Objects.requireNonNull( value );
}

public static StringMessage from( CharSequence s )
{
return s.length() == 0 ? EMPTY : new StringMessage( s.toString() );
}

@Override
public String asString() {
return value;
}

}
57 changes: 57 additions & 0 deletions src/it/projects/reloc-source-content-with-fqn/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<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>
<groupId>org.apache.maven.its.shade.rscwf</groupId>
<artifactId>test-parent</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<modules>
<module>impl</module>
<module>uber</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven.its.shade.rscwf</groupId>
<artifactId>test-impl</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit d758931

Please sign in to comment.