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

i have my project jar on my server and using this plugin i am try to install jar on m2 folder but it was not worked. can you please guide me for that #2

Open
aenky opened this issue Sep 28, 2018 · 4 comments
Assignees

Comments

@aenky
Copy link

aenky commented Sep 28, 2018

install Tesbo tesbo 0.0.1 true
            <executions>
                <execution>
                    <id>downloadjar</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>install</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <!-- Specify the MyMojo parameter -->
                <downloads>
                    <downloadArtifact>
                        <url>http://206.189.208.236:35420/files/abcd_0.0.1.jar</url>
                        <groupId>gui4j</groupId>
                        <artifactId>gui4j</artifactId>
                        <version>1.2.3</version>
                        <scope>compile</scope>
                    </downloadArtifact>
                </downloads>
            </configuration>

        </plugin>
    </plugins>
</build>
@aenky aenky changed the title i have my project jar on my server and using this plugin i am try to install jar on m2 folder but it was not worked. i have my project jar on my server and using this plugin i am try to install jar on m2 folder but it was not worked. can you please guide me for that Sep 28, 2018
@Huluvu424242
Copy link
Owner

Huluvu424242 commented Sep 30, 2018

Hello and thanks to using my software. My program was primary intendet to work for me two years ago to solve a little problem with maven. But i am happy to hear that other people use it. So i will be spend any prime time to this project again. (I have it not used for a long time)

Please give me more hints about your usage, such as:

  • wich kind of server environment you use - tomcat, spring-boot, aws-cloud, ngix ....?
  • is your project public to look at the sources?
  • wich os is using - win, apple, linux, android, ios, ...?
  • what mean does not work? Is there an exception or stacktrace?
  • is there an file at the correct place in the m2 repo but the file has wrong content such as blahblah.jar but the content is a html ?
  • Is the error again after manually clean the m2 place of the downloaded dependency?

Maybe a simple workaround is helping for a know bug?

  1. remove the the folder of downloaded dependency from m2 repo
  2. mvn clean validate
  3. check if the dependency now was downloaded correct
    Please give me a hint if this workaround was successful or had solved your problem, then i should solve issue Dependency resolution - override default lifecycle #1

Very thanks for your feedback

Thomas

@aenky
Copy link
Author

aenky commented Oct 1, 2018

Thank you sir for replay,
No sir its not working,
i have upload my jar on my server and its url is "http://206.189.208.236:3000/files/MarriottMoment_0.0.1.jar"
and i am use following way

    <plugin>
                <groupId>Tesbo</groupId>
                <artifactId>tesbo</artifactId>
                <version>0.0.1</version>
                <extensions>true</extensions>

                <executions>
                    <execution>
                        <id>downloadjar</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>install</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- Specify the MyMojo parameter -->
                    <downloads>
                        <downloadArtifact>
                            <url>http://206.189.208.236:3000/files/MarriottMoment_0.0.1.jar</url>
                            <groupId>gui4j</groupId>
                            <artifactId>gui4j</artifactId>
                            <version>1.2.3</version>
                            <scope>compile</scope>
                        </downloadArtifact>
                    </downloads>
                </configuration>

            </plugin>

and its not download my jar.
If you can fix it than it's get grate help to me.
Thank you sir,

@Huluvu424242
Copy link
Owner

Huluvu424242 commented Oct 3, 2018

Hello, ok i have tried my plugin - it works but my documentation is confusion.
So i have created a branch #2_test in this i have made a example solution for your problem. It is building correct - see the build at travis.

⚠️ HINT: Please use for the downloaded artifact your own maven coordinates (and not gui4j) such as

<downloadArtifact>
      <url>http://206.189.208.236:3000/files/MarriottMoment_0.0.1.jar</url>
      <groupId>Tesbo</groupId>
      <artifactId>tesbo</artifactId>
      <version>0.0.1</version>
</downloadArtifact>

I have overthink my old solution and i think the best way at the moment is the following way:

  • Add a profile to your pom.xml wich has only the task to download the dependencies via jar-install-plugin. So your build is untouched of this part. Here is an example of this profile definition:
<profiles>
        <!-- profile for download dependencies via jar-install-plugin -->
        <profile>
            <id>prepareProject</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.funthomas424242</groupId>
                        <artifactId>jar-install-plugin</artifactId>
                        <version>0.0.3</version>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>install</goal>
                                </goals>
                                <configuration>
                                    <!-- Specify the MyMojo parameter -->
                                    <downloads>
                                        <downloadArtifact>
                                            <url>http://206.189.208.236:3000/files/MarriottMoment_0.0.1.jar</url>
                                            <groupId>Tesbo</groupId>
                                            <artifactId>tesbo</artifactId>
                                            <version>0.0.1</version>
                                        </downloadArtifact>
                                    </downloads>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <repositories>
                <repository>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>bintray-funthomas424242-funthomas424242-maven-plugins</id>
                    <name>bintray</name>
                    <url>https://dl.bintray.com/funthomas424242/funthomas424242-maven-plugins</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>bintray-funthomas424242-funthomas424242-maven-plugins</id>
                    <name>bintray-plugins</name>
                    <url>https://dl.bintray.com/funthomas424242/funthomas424242-maven-plugins</url>
                </pluginRepository>
            </pluginRepositories>

        </profile>


    </profiles>

Then you can build your project with:

mvn -P prepareProject clean validate
mvn clean install

@Huluvu424242
Copy link
Owner

Was the solution for you usefull?

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

No branches or pull requests

2 participants