Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Relocated FatJarDetector Utility to generator/java-exec pacakge
Browse files Browse the repository at this point in the history
  • Loading branch information
Devang Gaur committed Feb 5, 2020
1 parent 8212c1c commit 02dc4e2
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public static JibBuildService.JibBuildConfiguration getJibBuildConfiguration(Bui
Credential pullCredential = getRegistryCredentials(pullRegistry, config.getDockerBuildContext().getRegistryConfig());

RegistryImage baseRegistryImage = RegistryImage.named(baseImage);
if (pullCredential != null) {
if (pullCredential!= null && !pullCredential.getUsername().isEmpty() && !pullCredential.getPassword().isEmpty()) {
baseRegistryImage.addCredential(pullCredential.getUsername(), pullCredential.getPassword());

}
Expand Down Expand Up @@ -331,8 +331,6 @@ public static void pushImage(TarImage baseImage, String targetImageName, Credent
}
}



private static Set<Port> getPortSet(List<String> ports) {
Set<Port> portSet = new HashSet<>();
for(String port : ports) {
Expand All @@ -342,21 +340,6 @@ private static Set<Port> getPortSet(List<String> ports) {
return portSet;
}

public static Path getFatJar(String buildDir, Logger log) {
FatJarDetector fatJarDetector = new FatJarDetector(buildDir);
try {
FatJarDetector.Result result = fatJarDetector.scan();
if(result != null) {
return result.getArchiveFile().toPath();
}

} catch (MojoExecutionException e) {
log.error("MOJO Execution exception occurred: %s", e);
throw new UnsupportedOperationException();
}
return null;
}

public static Credential getRegistryCredentials(String registry, RegistryService.RegistryConfig registryConfig) throws MojoExecutionException {
if (registry == null) {
registry = DOCKER_REGISTRY; // Let's assume docker is default registry.
Expand Down
1 change: 0 additions & 1 deletion generator/java-exec/src/main/java/FatJarDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.fabric8.maven.core.util;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.Map;

import io.fabric8.maven.core.util.Configs;
import io.fabric8.maven.core.util.FatJarDetector;
import FatJarDetector;
import io.fabric8.maven.core.util.MainClassDetector;
import io.fabric8.maven.core.util.MavenUtil;
import io.fabric8.maven.docker.config.AssemblyConfiguration;
Expand Down
1 change: 0 additions & 1 deletion generator/java-exec/src/test/java/FatJarDetectorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.fabric8.maven.core.util;

import java.io.File;
import java.net.URL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io.fabric8.maven.core.config.OpenShiftBuildStrategy;
import io.fabric8.maven.core.config.ProcessorConfig;
import io.fabric8.maven.core.util.ClassUtil;
import io.fabric8.maven.core.util.FatJarDetector;
import FatJarDetector;
import io.fabric8.maven.docker.config.AssemblyConfiguration;
import io.fabric8.maven.docker.config.ImageConfiguration;
import io.fabric8.maven.docker.util.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.apache.maven.plugins.assembly.model.FileSet;
import org.apache.maven.project.MavenProject;

import io.fabric8.maven.core.util.FatJarDetector;
import FatJarDetector;
import io.fabric8.maven.core.util.MavenUtil;
import io.fabric8.maven.docker.config.AssemblyConfiguration;
import io.fabric8.maven.docker.config.ImageConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.maven.project.MavenProject;
import org.junit.Test;

import io.fabric8.maven.core.util.FatJarDetector;
import FatJarDetector;
import io.fabric8.maven.docker.config.AssemblyConfiguration;
import io.fabric8.maven.docker.util.Logger;
import io.fabric8.maven.generator.api.GeneratorContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import io.fabric8.maven.docker.util.Logger;
import io.fabric8.maven.generator.api.GeneratorContext;
import io.fabric8.maven.generator.api.GeneratorMode;
import io.fabric8.maven.core.util.FatJarDetector;
import FatJarDetector;
import io.fabric8.maven.generator.javaexec.JavaExecGenerator;
import org.apache.commons.io.FileUtils;
import org.apache.maven.model.Plugin;
Expand Down

0 comments on commit 02dc4e2

Please sign in to comment.