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

Generating from archetype fails to populate plugin properties #42

Open
jdneo opened this issue Jul 26, 2018 · 5 comments
Open

Generating from archetype fails to populate plugin properties #42

jdneo opened this issue Jul 26, 2018 · 5 comments

Comments

@jdneo
Copy link
Member

jdneo commented Jul 26, 2018

by @rloutlaw

Plugin name and version

1.11 and 1.12 Maven releases from maven central. Java 8 and Maven 3.5.4.

Plugin configuration in your pom.xml

Relevant failing part:

UTF-8 1.8 1.8 1.0.0-beta-3 1.0.0-beta-4 helloworld-${package.getClass().forName("java.time.LocalDateTime").getMethod("now").invoke(null).format($package.Class.forName("java.time.format.DateTimeFormatter").getMethod("ofPattern", $package.Class).invoke(null, "yyyyMMddHHmmssSSS"))} ${package.getClass().forName("java.lang.StringBuilder").getConstructor($package.getClass().forName("java.lang.String")).newInstance("westus").toString()} ${project.build.directory}/azure-functions/${functionAppName} ${package.getClass().forName("java.lang.StringBuilder").getConstructor($package.getClass().forName("java.lang.String")).newInstance("java-functions-group").toString()}

Expected behavior

The functionAppName, AppRegion, and other fields have proper variable interpolation.

Actual behavior

Fields aren't generated / interpolated properly.

Steps to reproduce the problem

Generate a new project from archtype from Windows command line, Eclipse, or IntellliJ.

@jdneo
Copy link
Member Author

jdneo commented Jul 26, 2018

@rloutlaw I'm trying to repro this issue but have no luck. Could you please provide more information?

What's the minor version of Java 8?
Did you run it in CMD or bash or powershell?

@rloutlaw
Copy link

rloutlaw commented Jul 31, 2018

Java details (from the output of mvn -version)

Java version: 1.8.0_144, vendor: Azul Systems, Inc., runtime: C:\Java\1.8\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

And this was created via a cmd.exe terminal because I like breaking things.

@jdneo
Copy link
Member Author

jdneo commented Aug 1, 2018

@rloutlaw

Emm..... Seems we're entering the "works for me" scenario. I installed Azul JDK on my side but cannot repro the issue. Here is my output:

C:\Users\sheche>mvn -v
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)
Maven home: D:\Tools\apache-maven-3.5.4\bin\..
Java version: 1.8.0_144, vendor: Azul Systems, Inc., runtime: C:\Program Files\Zulu\zulu-8\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

C:\Users\sheche>mvn archetype:generate -DarchetypeGroupId=com.microsoft.azure -DarchetypeArtifactId=azure-functions-archetype
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype [com.microsoft.azure:azure-functions-archetype:1.12] found in catalog remote
Define value for property 'groupId': test111
Define value for property 'artifactId': test111
Define value for property 'version' 1.0-SNAPSHOT: :
Define value for property 'package' test111: :
Define value for property 'appName' test111-20180801105408324: :
Define value for property 'appRegion' westus: :
Define value for property 'resourceGroup' java-functions-group: :
Confirm properties configuration:
groupId: test111
artifactId: test111
version: 1.0-SNAPSHOT
package: test111
appName: test111-20180801105408324
appRegion: westus
resourceGroup: java-functions-group
 Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: azure-functions-archetype:1.12
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: test111
[INFO] Parameter: artifactId, Value: test111
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: test111
[INFO] Parameter: packageInPathFormat, Value: test111
[INFO] Parameter: appName, Value: test111-20180801105408324
[INFO] Parameter: resourceGroup, Value: java-functions-group
[INFO] Parameter: package, Value: test111
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: test111
[INFO] Parameter: appRegion, Value: westus
[INFO] Parameter: artifactId, Value: test111
[INFO] Project created from Archetype in dir: C:\Users\sheche\test111
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.062 s
[INFO] Finished at: 2018-08-01T10:54:09+08:00
[INFO] ------------------------------------------------------------------------

@PramodValavala-MSFT
Copy link

@jdneo
Unlike @rloutlaw, I don't have this problem when generating from the command line but I do see this issue when generating from eclipse as mentioned here.

It does seem to be an issue with eclipse since it works from the cli but just wanted to confirm.

@brunoborges
Copy link
Member

Close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants