Skip to content

Commit

Permalink
ITs for MJAR-307 - try to reproduce
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Apr 14, 2024
1 parent 902d4c5 commit ff57ff8
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 0 deletions.
57 changes: 57 additions & 0 deletions src/it/MJAR-307/pom.xml
@@ -0,0 +1,57 @@
<!--
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.apache.maven.plugins.jar.it</groupId>
<artifactId>mjar-307</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>it-mjar-307</name>

<properties>
<build.number>123</build.number>
<build.sealed>sealed</build.sealed>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Build>${build.number}</Implementation-Build>
<Sealed>${build.sealed}</Sealed>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>

</project>
32 changes: 32 additions & 0 deletions src/it/MJAR-307/src/main/java/foo/project003/App.java
@@ -0,0 +1,32 @@
package foo.project003;

/*
* 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.
*/

/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
32 changes: 32 additions & 0 deletions src/it/MJAR-307/verify.groovy
@@ -0,0 +1,32 @@
import java.util.jar.JarFile

/*
* 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.
*/

def target = new File( basedir, "target" );
def jarFile = new File( target, "mjar-307-1.0.jar" );

assert jarFile.exists()

def jar = new JarFile(jarFile)
assert jar.getEntry("META-INF/INDEX.LIST") != null

def manifest = jar.getManifest().getMainAttributes()
assert manifest.getValue("Implementation-Build") == "123"
assert manifest.getValue("Sealed") == "sealed"

0 comments on commit ff57ff8

Please sign in to comment.