Skip to content

Commit

Permalink
[ARCHETYPE-638] - fix: maven-archetype pom.xml should add request enc…
Browse files Browse the repository at this point in the history
…oding

This commit remove below warning:
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
  • Loading branch information
qxo committed Apr 4, 2023
1 parent 86826f0 commit ec356cb
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ public void createArchetype( ArchetypeCreationRequest request, ArchetypeCreation
try
{
File archetypePomFile = createArchetypeProjectPom( project, request.getProjectBuildingRequest(),
configurationProperties, outputDirectory );
configurationProperties, outputDirectory,
defaultEncoding );

File archetypeResourcesDirectory = new File( outputDirectory, getTemplateOutputDirectory() );

Expand Down Expand Up @@ -391,10 +392,15 @@ else if ( !properties.containsKey( Constants.PACKAGE ) )
* Create the archetype project pom.xml file, that will be used to build the archetype.
*/
private File createArchetypeProjectPom( MavenProject project, ProjectBuildingRequest buildingRequest,
Properties configurationProperties, File projectDir )
Properties configurationProperties, File projectDir,
String defaultEncoding )
throws TemplateCreationException, IOException
{
Model model = new Model();
if ( StringUtils.isNotBlank( defaultEncoding ) )
{
model.getProperties().put( "project.build.sourceEncoding", defaultEncoding );
}
model.setModelVersion( "4.0.0" );
// these values should be retrieved from the request with sensible defaults
model.setGroupId( configurationProperties.getProperty( Constants.ARCHETYPE_GROUP_ID, project.getGroupId() ) );
Expand Down

0 comments on commit ec356cb

Please sign in to comment.