proguard-spring-boot-example
proguard-spring-boot-example copied to clipboard
spring.boot.jar has not been obfuscated
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?
I'll check it tomorrow, give me please some time
@devslm You are running the Pre Obfuscate jar, But the post obfuscated jar is not working with java -jar command