Skip to content

spring.boot.jar has not been obfuscated #8

Description

@CodeSmolder

If I run mvn package, everything looks fine.

The file target/spring.boot.jar is running properly.

But if I unzip the file target/spring.boot.jar and pick a class file, which should have been obfuscated, the decompiler shows me:

package com.slm.proguard.example.spring.boot.service;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.slm.proguard.example.spring.boot.dto.ExampleDto;
import com.slm.proguard.example.spring.boot.dto.ExampleObjectMapperDto;
import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class ExampleService {
   private static final Logger LOGGER = LoggerFactory.getLogger(ExampleService.class);
   private final ObjectMapper objectMapper;
   private final ExampleDto exampleDto = ExampleDto.builder().variableInt(20).variableString("Test String").variableObject(new HashMap()).build();

   public int calculate() {
      return this.exampleDto.getVariableInt() * 10;
   }

   public String serializeObjectToString() throws Exception {
      ExampleObjectMapperDto exampleObjectMapper = (new ExampleObjectMapperDto()).setVariableInt(20).setVariableString("Test String").setVariableObject(new HashMap());
      return this.objectMapper.writeValueAsString(exampleObjectMapper);
   }

   public ExampleService(final ObjectMapper objectMapper) {
      this.objectMapper = objectMapper;
   }
}

Running the file target/spring.boot-obfuscated.jar will not work either and show the error mention in #4.

What am I doing wrong?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions