1

I've already succeed creating java project on vs code. I am installing Java extension pack which is auto install another plugin (like language support by red hat and etc), I am using jdk 8 (jdk1.8.0_241). I am using command palette to create new java project. But my new project doesn't contain pom.xml

Anyway I don't install dedicated maven, only Maven for java extension

I need maven for iReport/jaspers dependencies

4
  • 1
    you should create a maven project not a java project,you could press F1 > then input Create,select Create Maven Project,or refer to command create maven project Commented Mar 5, 2020 at 8:08
  • 1
    ^they ask me "select archtypes", not sure what it's it. usually I did it on netbeans before when I was on college. so I don't know what is it Commented Mar 6, 2020 at 4:12
  • 1
    In short, Archetype is a Maven project templating toolkit.you could look at maven.apache.org/guides/introduction/… you could select maven-archetype-quickstart which is an archetype to generate a sample Maven project. Commented Mar 6, 2020 at 8:31
  • 1
    I've tried type in terminal: mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 but it doesn't work, the error is: The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\bambang.sugianto\Documents\java projects). Please verify you invoked Maven from the correct directory. -> [Help 1] Commented Mar 6, 2020 at 11:31

2 Answers 2

3

You can execute this by cmd:

mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=com.mycompany.app -DartifactId=my-app

This will generate a maven-archetype-quickstar project.

Sign up to request clarification or add additional context in comments.

1 Comment

3

You are probably creating a new "Java Project", which is Eclipse-based structure, not Maven.

In the command pallet (Cmd+P on macOS), type Maven and you shall see "Maven: Create Maven Project".

enter image description here

Next step, the extension will ask you which Maven Archetype to use. Select "maven-archetype-quickstart".

enter image description here

You will be asked for input on the terminal after this.

Once the project is generated, type $ code to open a new VSC window.

Done.

2 Comments

I can't find that archetype, any suggest?
this creates lots of eclipse files for me, despite running vscode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.