Why are Maven generated-sources not getting compiled? [duplicate]

The build-helper plugin indeed solved the problem. Thanks @Joe for the comment. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>${project.build.directory}/generated-sources/wrappers</source> </sources> </configuration> </execution> </executions> </plugin>

Maven plugin for Tomcat 9

You can use the plugin to deploy to a separately running tomcat 9. The run goals won’t work, but the deploy goals will. <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <url>http://localhost:8080/manager/text</url> <server>TomcatServer</server> <path>/myapp</path> </configuration> </plugin> Maven goals: mvn tomcat7:deploy mvn tomcat7:undeploy mvn tomcat7:redeploy Note: Don’t forget to add tomcat user in tomcat-users.xml and maven settings.xml tomcat-user.xml <?xml … Read more

How can I use a default value if an environment variable isn’t set for resource filtering in maven?

I’m using the profile for determining as <profiles> <profile> <activation> <activeByDefault>true</activeByDefault> <property> <name>!myproperty</name> </property> </activation> … <properties> <myproperty>some value</myproperty> </properties> </profile> … </profiles> Please note The activeByDefault is set to true with purpose to enable it by default. The !myproperty means this property is missing or not existed. If the myproperty is not existed, just … Read more

Can I configure multiple plugin executions in pluginManagement, and choose from them in my child POM?

You’re correct, by default Maven will include all of the executions you have configured. Here’s how I’ve dealt with that situation before. <pluginManagement> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>some-maven-plugin</artifactId> <version>1.0</version> <executions> <execution> <id>first-execution</id> <phase>none</phase> <goals> <goal>some-goal</goal> </goals> <configuration> <!– plugin config to share –> </configuration> </execution> <execution> <id>second-execution</id> <phase>none</phase> <goals> <goal>other-goal</goal> </goals> <configuration> <!– plugin config to share … Read more

How to create a project using maven-archetype-plugin? What is artefactId etc?

mvn archetype:generate command is used to create a project from an existing template. There are several archetype’s defined by many developers and project groups. When you run the command, maven does following things: Downloads maven-archetype-plugin’s latest version. Lists all archetype’s that can be used to create a project from. If you defined an archetype while … Read more

What is the difference between artifactId and groupId in pom.xml?

From maven.apache.org, Naming Conventions: artifactId is the name of the jar without version. If you created it then you can choose whatever name you want with lowercase letters and no strange symbols. If it’s a third party jar you have to take the name of the jar as it’s distributed. eg. maven, commons-math groupId will … Read more

How to eliminate the “maven-enforcer-plugin (goal “enforce”) is ignored by m2e” warning by eclipse?

The eclipse maven plugin runs a projects pom.xml file in order figure out how the maven project is configured and translate the maven pom.xml configuration into an eclipse configuration. A pom.xml can reference an arbitrary number of maven plugins and each of those plugins has the potential to leak memory, or do things that are … Read more