C4 - Lesson 3: Dependency Management with Maven Flashcards

1
Q

What is a plugin?

A
  • Any application that performs actions during the maven build process.
  • perform goals
    Ex: packaging
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Plugin Management vs. Plugins.

A
  • Plugins: customization for this project only

- PluginManagement: customization for all projects that inherit this as well

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to configure plugins?

A

You can pass additional properties to plugins using the element [configure]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is mavens default lifecycle

A

Validate, compile, test, package, install, deploy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to run a specific phase?

A

mvn {phase}

It will execute all previous phase and the phase

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Pom 4 required elements:

A
  • modelVersion: The format of the current pom. Should always be 4.0.0 at this time.
  • groupId: The group identifier for your project. Can be shared with other projects.
  • artifactId: The specific identifier for this project. Combination of artifactId and groupId uniquely identifies your project.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is maven standard layout?

A

src:

main: Contains source code and resources related to your project.
test: Contains source code and resources for testing your project.
java: Both Java folders hold your .java source files.

resources: Contains non-java files related to running and building your project. Commonly holds properties files, images
filters: Contains resource filter files that Maven will use when filtering resources. Property files inject values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Maven benefits:

A

Maven can automatically download project dependencies and include them as part of your project build

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Dependency Scope?

A

The scope element of a dependency tells Maven when to include that dependency.

  • Compile: Default scope. Dependency will be available for all Maven actions.
  • Test, Runtime
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are transitive dependencies?

A
  • A transitive dependency is a resource required by one of the dependencies included in your project.
  • If your project has multiple transitive dependencies, the nearest definition will win.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to Resolving Transitive Dependencies

A
  • Directly include the dependency in question. The version you use will become the nearest definition and be selected by Maven.
  • Use the [exclusion] tag to specifically exclude versions you do not wish to use.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What uniquely identifies your project.

A

Combination of artifactId and groupId uniquely identifies your project.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to create a New Maven Project

A

You can create Maven projects running the archetype:generate goal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to add Maven Run Configurations?

A

You can save various Maven commands as run configurations. Click Add Configuration on the above screen and then use the + icon and scroll down to Maven

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to execute maven phases in IntelliJ?

A

opening the Maven tools window on the right side of your IDE, expanding the lifecycle category, and then right clicking on the phase you want to run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly