Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ARCHETYPE-638] maven-archetype pom.xml should add request encoding #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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