Skip to content

Commit

Permalink
Keep stacktrace in case of warning in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsbasjes committed Mar 12, 2023
1 parent 6021a48 commit b54efd4
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.codehaus.plexus.components.interactivity.Prompter;
import org.codehaus.plexus.components.interactivity.PrompterException;
import org.codehaus.plexus.util.StringUtils;
import org.slf4j.Logger;

import static java.util.Objects.requireNonNull;
import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
Expand Down Expand Up @@ -398,7 +399,18 @@ private String resolveSuggestedVersion( String baseVersion,
}
catch ( ScmRepositoryException | NoSuchScmProviderException e )
{
getLogger().warn( "Next Version will NOT be based on the version control: {}", e.getMessage() );
Logger logger = getLogger();
if ( logger.isWarnEnabled() )
{
logger.warn( "Next Version will NOT be based on the version control: {}", e.getMessage() );
}
else
{
if ( logger.isDebugEnabled() )
{
logger.warn( "Next Version will NOT be based on the version control", e );
}
}
}
}
return convertToSnapshot ? policy.getDevelopmentVersion( request ).getVersion()
Expand Down

0 comments on commit b54efd4

Please sign in to comment.