Problem with deploying mvn archetype to localhost. | Community
Skip to main content
Karl515
Level 5
Jan 31, 2019 7:13 AM UTC
Solved

Problem with deploying mvn archetype to localhost.

Hello there!

I have this problem that when I install using eclipse, it only installs to my .m2 repository instead of localhost:4502. What could be the cause of this?

-already make sure the base POM file is pointing to localhost:4502

Now I'm having thoughts it's because if the setting.xml that WKND tut let me put in .m2. but if I delete the setting.xml. I'm getting an error.

How can I let eclipse to install in localhost:4502? Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Jan 31, 2019 7:12 PM UTC

For Java EE (aka Eclipse) to produce the same results do this -

1) Right click on the project folder that you want to build

2) Click on Run as > Maven Build...

3) Mention the goals & profile that you want to execute:  clean install -PautoInstallPackage

4) Hit Run and check the results

11 replies

Karl515
Karl515Author
Level 5
Feb 1, 2019 1:49 AM UTC

Thanks! works like charm. It still says Installed on .m2 repository but it reflects to my localhost too!

P.S. I also did got some errors so this is my build Profile:

if your getting POM errors, just add adobe-public. cheers and thanks!

Translate
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Jan 31, 2019 7:12 PM UTC

For Java EE (aka Eclipse) to produce the same results do this -

1) Right click on the project folder that you want to build

2) Click on Run as > Maven Build...

3) Mention the goals & profile that you want to execute:  clean install -PautoInstallPackage

4) Hit Run and check the results

Translate
Karl515
Karl515Author
Level 5
Jan 31, 2019 6:43 PM UTC

Heres mine. I think we have the same

<profile>

            <id>autoInstallPackage</id>

            <activation>

                <activeByDefault>false</activeByDefault>

            </activation>

            <build>

                <pluginManagement>

                    <plugins>

                        <plugin>

                            <groupId>org.apache.jackrabbit</groupId>

                            <artifactId>filevault-package-maven-plugin</artifactId>

                            <executions>

                                <execution>

                                    <id>create-package</id>

                                    <goals>

                                        <goal>package</goal>

                                    </goals>

                                </execution>

                            </executions>

                        </plugin>

                        <plugin>

                            <groupId>com.day.jcr.vault</groupId>

                            <artifactId>content-package-maven-plugin</artifactId>

                            <executions>

                                <execution>

                                    <id>install-package</id>

                                    <goals>

                                        <goal>install</goal>

                                    </goals>

                                    <configuration>

                                        <targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>

                                    </configuration>

                                </execution>

                            </executions>

                        </plugin>

                    </plugins>

                </pluginManagement>

            </build>

        </profile>

Translate
Karl515
Karl515Author
Level 5
Jan 31, 2019 6:39 PM UTC

Update.

CMD and JAVA EE displays the same result, but CMD deploys to localhost even tho displays to .m2. but Java EE displays installed to .m2 and also doesn't reflect to localhost.

Wierd

Translate
Gaurav-Behl
Level 10
Jan 31, 2019 6:36 PM UTC

Can you search for the below section in your pom.xml?  The 'id' mentioned is your profile name which you can pass to mvn command like Scott mentioned above using -P flag

If its missing then add it and test.

mvn clean install -PautoInstallPackage

<profiles>

<!-- something here -->

   <profile>

            <id>autoInstallPackage</id>

            <activation>

                <activeByDefault>false</activeByDefault>

            </activation>

            <build>

                <pluginManagement>

                    <plugins>

                        <plugin>

                            <groupId>org.apache.jackrabbit</groupId>

                            <artifactId>filevault-package-maven-plugin</artifactId>

                            <executions>

                                <execution>

                                    <id>create-package</id>

                                    <goals>

                                        <goal>package</goal>

                                    </goals>

                                </execution>

                            </executions>

                        </plugin>

                        <plugin>

                            <groupId>com.day.jcr.vault</groupId>

                            <artifactId>content-package-maven-plugin</artifactId>

                            <executions>

                                <execution>

                                    <id>install-package</id>

                                    <goals>

                                        <goal>install</goal>

                                    </goals>

                                    <configuration>

                                        <targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>

                                    </configuration>

                                </execution>

                            </executions>

                        </plugin>

                    </plugins>

                </pluginManagement>

            </build>

        </profile>

<!-- something here -->

</profiles>

Translate
Karl515
Karl515Author
Level 5
Jan 31, 2019 6:27 PM UTC

Still went to my repo

Base POM

Translate
Karl515
Karl515Author
Level 5
Jan 31, 2019 6:21 PM UTC

I didn't touch any Profile. I just set my MAVEN_HOME and path. I can deploy directly before, then this suddenly happens.

Translate
smacdonald2008
Level 10
Jan 31, 2019 4:56 PM UTC

Try opening up your project in Command line and typing:

mvn -PautoInstallPackage install

That should deploy your project to AEM.

Let us know if you are successful with that command.

Translate
joerghoh
Employee
Jan 31, 2019 4:30 PM UTC

how does your maven command look like? Do you use a specific profile? (The deployment to a local AEM instance requires you to enable a specific profile, don't know its name from the top of my head).

Jörg

Translate
Karl515
Karl515Author
Level 5
Jan 31, 2019 10:07 AM UTC

default.

I'm not having this problem before. it just suddenly happen.

It goes to my .m2 repository.

I've got my base POM setup right.

using CMD or Eclipse JAVA EE. produces same results.

Translate