Does the Spring-Flex 1.5 Sample work? - java

The samples and documentation in question can be found here: http://static.springsource.org/spring-flex/docs/1.5.0.M1/
The reference doc ( here ) tells us to download the sample application:
Included in the project distribution
is a collection of samples called the
Spring BlazeDS Integration Test Drive.
This samples project is set up to be
built with Maven and then imported
into Eclipse for running the
application via WTP.
The samples in question, must either be spring-flex-testdrive-spring3.zip which is linked to in the document or spring-flex-testdrive-spring3.zip based on the notion that this is release 1.5.0.M1 (docs and samples).
After I configure maven as described with the proper environment variable:
MAVEN_OPTS="-Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m"
I then execute (per instruction) the command to install: mvn clean install from the extracted samples directory (in my case C:\spring-flex-testdrive ), I receive the following error:
C:\spring-flex-testdrive>mvn clean install
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.springframework.flex.samples:spring-flex-testdrive:1.5.0.M1 (C:\spring-flex-testdrive\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find org.springframework.flex:spring-flex-parent:pom:1.5.0.M1 in http://maven.springframework.org/external was cached in the local repository, resolution will not be
reattempted until the update interval of spring-external has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
C:\spring-flex-testdrive>
I have managed to get a "Spring BlazeDS" application working (with Flex), but now I'm at the point where I need to implement security, and if the samples would compile and run correctly, it'd be a huge help. I am new to Maven, but any help would be greatly appreciated!
Thanks in advance StackOverflow community!

Brian, please add the following snippet to the pom.xml in the root of the samples (from where you execute mvn clean install) and re-run Maven:
<repository>
<id>spring-milestone</id>
<name>Spring Milestone Repository</name>
<url>http://maven.springframework.org.s3.amazonaws.com/milestone</url>
</repository>
Hope that helps.
Christian

I get the same error. Spring Flex 1.5M2 will be out very soon. So maybe give it another try with that.

I would recommend that if go with Parsley for Actionscript/Flex framework. It is more mature in may ways than Spring-Actionscript. Moreover it is a required library for much of Cairngorm 3. Good luck.

Related

Apache Flink with AWS Kinesis Analytics

The actual situation
I want to use Apache Flink with Kinesis Analytics. Like I don't have experience with Java and Maven and going to try to summary the steps I followed and the results.
Use IntelliJ IDEA as IDE
Test this example without any problems
Change to AWS, following their instruction. The problems start in the step: Create and Compile the Apache Flink Streaming Java Code
The problems
If you want to use the Kinesis connector, you can not do it like other connector due to the ASL license and they do not deploy the artifact to the Maven central repository on Flink releases, so you will need to build the Kinesis connector by yourself download the source code for the connector from here Apache Flink, and install it to your local Maven repository.
After download it, you have build the module following this steps:
mvn clean install -Pinclude-kinesis -DskipTests
So I move to the unziped folder, and run the mvn command, with this error:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.670 s
[INFO] Finished at: 2018-12-27T14:35:13+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.12:check (default) on project flink-parent: Too many files with unapproved license: 2 See RAT report in: C:\Users\...\flink-master\target\rat.txt -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :flink-parent
Trying to find a solution, I tried what this user said here
mvn clean install -Pinclude-kinesis -DskipTests -Drat.ignoreErrors=true package
But again, I had an error:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:15 min
[INFO] Finished at: 2018-12-27T14:40:47+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project flink-shaded-hadoop2: Could not resolve dependencies for project org.apache.flink:flink-shaded-hadoop2:jar:1.8-SNAPSHOT: Could not find artifact jdk.tools:jdk.tools:jar:1.6 at specified path C:\Program Files\Java\jdk-11/../lib/tools.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :flink-shaded-hadoop2
The questions
How should I build the connector module?
How should I install it to my local Maven repository?
After receiving similar errors, even after using the other answer's solution for checking out a release branch, I found a solution that works for me. According to the build guide in the Flink docs, you can also add the -Dfast option to speed up build time. In my case, this resolved the licensing errors:
mvn clean install -Pinclude-kinesis -DskipTests -Dfast
I think that the problem is that you're trying to build the "snapshot" build of the Flink connector, not the release build.
Since you're not familiar with Java and Maven, here's what that means: Maven differentiates between "snapshot" builds, which are currently under active development, and "release" builds. Normally a project only pushes its release builds to Maven Central. However, for long-running development, the "master" branch is often a snapshot.
The POM in your linked instructions references version 1.6.2, so that's what you should be building. Check out the tag release-1.6.2, and also make sure that you're reading the Flink documentation for that version (your link above is for the latest development version).

Not able to deploy artifacts to Nexus repository from Jenkins

I am trying to push my artifacts to Nexus from Jenkins. I am getting the following error while I deploy to Nexus from Jenkins:
Error message in Jenkins Console Output:
15:59:06 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project sbx-java-webapp: Failed to deploy artifacts/metadata: Cannot access with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
15:59:06 [ERROR] role: org.apache.maven.wagon.Wagon
15:59:06 [ERROR] roleHint: "http
15:59:06 [ERROR] -> [Help 1]
15:59:06 [ERROR]
15:59:06 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
15:59:06 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
15:59:06 [ERROR]
15:59:06 [ERROR] For more information about the errors and possible solutions, please read the following articles:
15:59:06 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I have tried several methods to make this work. But when I use maven deploy goal in my windows machine, it is deploying my artifacts to the same Nexus Repository without any failure. However from Jenkins, I am getting this error. In both environment the pom.xml and settings.xml that I use are same. I have tried with different maven versions as well in jenkins to solve this issue, but no help.
I have already tried mentioning wagonProvider in CLI as well as settings.xml and also I tried using extensions for wagonProviders in build and I even used extensions.xml and include this in descriptor in maven version 3.0.5 where WagonTransporterFactory is available, but none of them help me out. I also tried reinstalling and reconfiguring Jenkins, but that also doesn't help me.
If we can solve this issue, it will be great help. Thanks.
Oh....I got the issue resolved. Another example that teaches me a small error can result in bigger issue.
The issue occurred as I was passing my Nexus Repository URL as system variable in jenkins for maven deploy command as follows:
nexus_rel_repo="${NEXUS_REPO_URL}"
where NEXUS_REPO_URL was already a String Parameter that I assigned in Jenkins. And nexus_rel_repo is my system variable and you can see here that I was using double quotes when I was assigning my Nexus Repository URL which is already a String Parameter to nexus_rel_repo. The occurrence of these extra double quotes disturbed the connection.
Thanks for everyone who has looked into this issue and who has already done some research on it.

Maven time out on Central Repository - No Proxy setting - Windows

Maven throws time out when try to clean the project
USER>mvn clean
After this command the build throw:
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dep
endencies could not be resolved: Failed to read artifact descriptor for org.apac
he.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apa
che.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven
.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org
/23.235.46.215] failed: Connection timed out: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
onException
Do you have any other repositories configured in your ${HOME}/.m2/settings.xml (or pom.xml)? If so, make sure that none of them have the id of central or you may have reconfigured the location of maven-central.
Also, if you use a locally hosted "proxy" maven repository, do not reconfigure central to point to the locally hosted maven repository, instead use a "mirror" directive, configuring the repository to be something with an id like "localrepo" and specifying it as a "mirrorOf" central.
Finally, avoid any "proxy" settings unless you want all of your searches to start searching for repositories outside of your network (aka on the internet).
Maven manages dependencies in a very specific manner, which provides repeat-ability of builds. Basically it needs to be encoded in the pom.xml. Yes, you can do some magic to pass such things through using the command line, but if you do that, you are working against the design of maven (and robbing yourself of most of it's utility at the same time).
If you need something to "update" a build, consider making a script that updates and checks in the pom.xml for the artifact, or (less ideal) base the dependency on a snapshot version.

Maven, lost local dependency | Could not resolve dependencies for project

Hi guys I have a Maven project working well since 9 months.
But today I get a error in Maven build
[ERROR] Failed to execute goal on project bon: Could not resolve dependencies for project com.mydev:bon:war:1.0.20.1: Failure to find com.mydev:utils:jar:1.0.0-BUILD-SNAPSHOT in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of maven2 has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
The project is a Dynamic Web Project with maven
In pom I have a dependency to local jar
<dependency>
<groupId>com.mydev</groupId>
<artifactId>utils</artifactId>
<version>1.0.0-BUILD-SNAPSHOT</version>
</dependency>
The project com.mydev.utils has installed in my PC in .m2 folder, I check the folder D:\.m2\repository\com\mydev\utils\1.0.0-BUILD-SNAPSHOT\ and everything seems in order
_rzi_0.118
_rzi_0.227
_maven.repositories
utils-1.0.0-BUILD-SNAPSHOT.jar
utils-1.0.0-BUILD-SNAPSHOT.jar.lastUpdate
utils-1.0.0-BUILD-SNAPSHOT.pom
utils-1.0.0-BUILD-SNAPSHOT.pom.lastUpdate
m2e.lastUpdate.properties
maven-metadata-local.xml
resolver-status.properties
I do not think the problem is the pom, I have not changed anything
I tried to build another project with the same unit, and get the same error.
I install software yesterday (DB2 Express-C database server), not if maven may have lost some settings for it. wheninstall the software, do not restart
Today try to generate the war, but I get the error, I reboot the PC, but I have the same error
Edit:
One more thing you do not need to do copy and paste thing , you can just easily modify your maven setting.xml for maven repo and in eclipse point it to correct file. In above scree shot user setting path should be you maven installation dir like <your dir>\apache-maven-xxx\conf\settings.xml
settings.xml
<localRepository>D:\.m2</localRepository>

How to build this source code? - missing dependency

I need a help how to build this example:
http://blogs.oracle.com/arungupta/resource/totd154.zip
from this tutorial
http://blogs.oracle.com/arungupta/entry/totd_154_dynamic_osgi_services
I installed Netbeans 7.1. When I click Clean and Build this error occurs:
Failed to execute goal on project helloworld-cdiclient: Could not resolve dependencies for project org.samples.osgi.helloworld:helloworld-cdiclient:war:1.0-SNAPSHOT: Could not find artifact org.glassfish:osgi-cdi-api:jar:3.1-SNAPSHOT -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
After correcting the problems, you can resume the build with the command
mvn <goals> -rf :helloworld-cdiclient
I suppose that I need to add a specific glassfish repository to the maven configuration. Which repository I need?
Quoting my comments (sorry I though it will give chance to someone else to answer properly and not on the run):
To answer your question, download.java.net/maven/glassfish should help. The configuration lines are,
<repositories>
<repository>
<id>glassfish-repo</id>
<name>The Glassfish repository</name>
<url>http://download.java.net/maven/glassfish/</url>
</repository>
<!-- all the rest... -->
</repositories>
Have fun!

Categories