@@ -0,0 +1,2835 @@
+package com.github.manouti.normalize;%0A%0A/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Aimport java.io.BufferedOutputStream;%0Aimport java.io.File;%0Aimport java.io.FileOutputStream;%0Aimport java.io.InputStream;%0Aimport java.util.Date;%0Aimport java.util.Enumeration;%0Aimport java.util.jar.JarEntry;%0Aimport java.util.jar.JarFile;%0Aimport java.util.jar.JarOutputStream;%0A%0Aimport org.apache.maven.plugin.MojoExecutionException;%0Aimport org.codehaus.plexus.component.annotations.Component;%0Aimport org.codehaus.plexus.util.IOUtil;%0A%0A@Component( role = Normalizer.class, hint = %22default%22 )%0Apublic class DefaultNormalizer implements Normalizer %7B%0A%0A%09private ManifestTransformer manifestTransformer = new ManifestTransformer();%0A%09private PomPropertiesTransformer pomPropertiesTransformer = new PomPropertiesTransformer();%0A%0A%09@Override%0A%09public void normalize(File jarFile, Date timestamp, File outputFile) throws MojoExecutionException %7B%0A%09%09JarOutputStream jarOutputStream = null;%0A%09%09try %7B%0A%09%09%09JarFile jar = new JarFile(jarFile);%0A%09%09%09outputFile.getParentFile().mkdirs();%0A%09%09%09FileOutputStream fileOutputStream = new FileOutputStream(outputFile);%0A%09%09%09jarOutputStream = new JarOutputStream( new BufferedOutputStream(fileOutputStream));%0A%09%09%09for (Enumeration%3CJarEntry%3E en = jar.entries(); en.hasMoreElements();) %7B%0A%09%09%09%09JarEntry entry = en.nextElement();%0A%09%09%09%09entry.setTime(timestamp.getTime());%0A%09%09%09%09%0A%09%09%09%09String resource = entry.getName();%0A%09%09%09%09if (resource.equalsIgnoreCase(JarFile.MANIFEST_NAME)) %7B%0A%09%09%09%09%09manifestTransformer.normalizeManifest(jarOutputStream, jar, entry, timestamp);%0A%09%09%09%09%7D else if(resource.endsWith(%22/pom.properties%22)) %7B%0A%09%09%09%09%09pomPropertiesTransformer.normalizePropertiesFile(jarOutputStream, jar, entry, timestamp);%0A%09%09%09%09%7D else if (!entry.isDirectory()) %7B%0A%09%09%09%09%09InputStream inputStream = jar.getInputStream(entry);%0A%09%09%09%09%09jarOutputStream.putNextEntry(entry);%0A%09%09%09%09%09IOUtil.copy(inputStream, jarOutputStream);%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D catch (Throwable th) %7B%0A%09%09%09outputFile.delete();%0A%09%09%09throw new MojoExecutionException( %22Error in default normalizer%22, th );%0A%09%09%7D finally %7B%0A%09%09%09IOUtil.close(jarOutputStream);%0A%09%09%7D%0A%09%7D%0A%09%0A%7D%0A

Create DefaultNormalizer.java